diff options
Diffstat (limited to 'app/wlib/gtklib/list.c')
-rw-r--r-- | app/wlib/gtklib/list.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/app/wlib/gtklib/list.c b/app/wlib/gtklib/list.c index ac66aba..2080b9f 100644 --- a/app/wlib/gtklib/list.c +++ b/app/wlib/gtklib/list.c @@ -238,16 +238,20 @@ wIndex_t wListGetValues( if (bl->type == B_DROPLIST && bl->editted) { entry_value = gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN( bl->widget)))); - item_data = NULL; + item_data = NULL; inx = bl->last = -1; } else { - inx = bl->last; + //Make sure in range + if (bl->last > bl->count-1) bl->last = bl->count-1; + inx = bl->last; + if (inx >= 0) { id_p = wlibListStoreGetContext(bl->listStore, inx); if (id_p==NULL) { fprintf(stderr, "wListGetValues - id_p == NULL\n"); + bl->last = -1; } else { entry_value = id_p->label; item_data = id_p->itemData; @@ -410,6 +414,9 @@ void wListDelete( b->count--; } + if (b->last == inx-1) b->last = -1; + else if (b->last >= inx) b->last = -1; + b->recursion--; return; } @@ -426,7 +433,7 @@ void wListDelete( int wListGetColumnWidths( wList_p bl, int colCnt, - wPos_t * colWidths) + wWinPix_t * colWidths) { int inx; @@ -510,7 +517,7 @@ wIndex_t wListAddValue( * \param h IN height (ignored for droplist) */ -void wListSetSize(wList_p bl, wPos_t w, wPos_t h) +void wListSetSize(wList_p bl, wWinPix_t w, wWinPix_t h) { if (bl->type == B_DROPLIST) { gtk_widget_set_size_request(bl->widget, w, -1); @@ -534,13 +541,13 @@ void wListSetSize(wList_p bl, wPos_t w, wPos_t h) wList_p wComboListCreate( wWin_p parent, /* Parent window */ - wPos_t x, /* X-position */ - wPos_t y, /* Y-position */ + wWinPix_t x, /* X-position */ + wWinPix_t y, /* Y-position */ const char * helpStr, /* Help string */ const char * labelStr, /* Label */ long option, /* Options */ long number, /* Number of displayed list entries */ - wPos_t width, /* Width */ + wWinPix_t width, /* Width */ long *valueP, /* Selected index */ wListCallBack_p action, /* Callback */ void *data) /* Context */ |