# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1053020164 0 # Node ID c1c75e363a91d68817dd377c329344ed83ad84d4 # Parent 3269c10bc243e8dad0552d69f016ded83a2d9553 Hopefully fixed dw_listbox_selected() on GTK 2.x. diff -r 3269c10bc243 -r c1c75e363a91 gtk/dw.c --- a/gtk/dw.c Thu May 15 16:32:54 2003 +0000 +++ b/gtk/dw.c Thu May 15 17:36:04 2003 +0000 @@ -7078,10 +7078,23 @@ int counter = 0; GList *list = GTK_LIST(handle2)->children; #if GTK_MAJOR_VERSION > 1 - GList *selection = GTK_LIST(handle2)->undo_unselection; + + while(list) + { + GtkItem *item = (GtkItem *)list->data; + + if(item && item->bin.container.widget.state == GTK_STATE_SELECTED) + { + retval = counter; + break; + } + + list = list->next; + counter++; + } #else GList *selection = GTK_LIST(handle2)->selection; -#endif + if(selection) { while(list) @@ -7096,6 +7109,7 @@ counter++; } } +#endif } DW_MUTEX_UNLOCK; return retval;