summaryrefslogtreecommitdiff
path: root/draw.c
diff options
context:
space:
mode:
authorlouie <lshprung@yahoo.com>2020-06-22 21:08:10 -0700
committerlouie <lshprung@yahoo.com>2020-06-22 21:08:10 -0700
commit43eeda3d0982160d7863dd2268d989f79c24f03f (patch)
tree8beca0a69f63b520683148f3a265b8b5806c7f6b /draw.c
parent4ca501cb1ded2bf4466a28fcad28a6b7c60d8aff (diff)
Altered Group Structure and cfg
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/draw.c b/draw.c
index 888ac26..4fc69a0 100644
--- a/draw.c
+++ b/draw.c
@@ -36,6 +36,11 @@ int main(){
bool wide = true; //is the window a certain width (tbd what the threshold should be TODO)
int input;
+ //Fill Groups
+ cfg_interp(); //read the contents of the cfg file
+ g = get_groups(); //retrieve results of previous function
+ g_count = get_gcount(g); //retrieve number of groups in g
+
initscr();
cbreak();
keypad(stdscr, true);
@@ -67,11 +72,6 @@ int main(){
draw_win(group_win, "GROUP");
draw_win(entry_win, "ENTRY");
draw_win(info_win, "INFO");
-
- //Fill Groups
- cfg_interp(); //read the contents of the cfg file
- g = get_groups(); //retrieve results of previous function
- g_count = get_gcount(g); //retrieve number of groups in g
fill_groups(g, g_count);
//start with hover on the first group, draw the entries from the selected group, true_hover is over the groups (rather than the entries)
@@ -151,7 +151,7 @@ void fill_groups(GROUP **group_arr, int count){
name = get_gname(group_arr[i]);
//the name is too long, take the group to the trimming function
- if(strlen(name) > max_len) name = trim_name(name, get_gpath(group_arr[i]), max_len);
+ if(strlen(name) > max_len) name = trim_name(name, get_gname(group_arr[i]), max_len);
wmove(group_win, ycoord, 1);
wprintw(group_win, "%s", name);
ycoord++;
@@ -182,7 +182,7 @@ void fill_entries(ENTRY **entry_arr, int count){
return;
}
-//FIXME issue trimming entry
+//FIXME issue trimming entries with path title
char *trim_name(char *name, char *path, int max_len){
char *tok; //for use in finding relative path name
char *tok_ahead;