comparison gtk/dw.c @ 423:c1c75e363a91

Hopefully fixed dw_listbox_selected() on GTK 2.x.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 15 May 2003 17:36:04 +0000
parents 3269c10bc243
children 5cc81d3c2bca
comparison
equal deleted inserted replaced
422:3269c10bc243 423:c1c75e363a91
7076 if(GTK_IS_LIST(handle2)) 7076 if(GTK_IS_LIST(handle2))
7077 { 7077 {
7078 int counter = 0; 7078 int counter = 0;
7079 GList *list = GTK_LIST(handle2)->children; 7079 GList *list = GTK_LIST(handle2)->children;
7080 #if GTK_MAJOR_VERSION > 1 7080 #if GTK_MAJOR_VERSION > 1
7081 GList *selection = GTK_LIST(handle2)->undo_unselection; 7081
7082 while(list)
7083 {
7084 GtkItem *item = (GtkItem *)list->data;
7085
7086 if(item && item->bin.container.widget.state == GTK_STATE_SELECTED)
7087 {
7088 retval = counter;
7089 break;
7090 }
7091
7092 list = list->next;
7093 counter++;
7094 }
7082 #else 7095 #else
7083 GList *selection = GTK_LIST(handle2)->selection; 7096 GList *selection = GTK_LIST(handle2)->selection;
7084 #endif 7097
7085 if(selection) 7098 if(selection)
7086 { 7099 {
7087 while(list) 7100 while(list)
7088 { 7101 {
7089 if(list->data == selection->data) 7102 if(list->data == selection->data)
7094 7107
7095 list = list->next; 7108 list = list->next;
7096 counter++; 7109 counter++;
7097 } 7110 }
7098 } 7111 }
7112 #endif
7099 } 7113 }
7100 DW_MUTEX_UNLOCK; 7114 DW_MUTEX_UNLOCK;
7101 return retval; 7115 return retval;
7102 } 7116 }
7103 7117