diff options
Diffstat (limited to 'src/fe-gtk/gtkutil.c')
-rw-r--r-- | src/fe-gtk/gtkutil.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/fe-gtk/gtkutil.c b/src/fe-gtk/gtkutil.c index a6870253..3bb247a2 100644 --- a/src/fe-gtk/gtkutil.c +++ b/src/fe-gtk/gtkutil.c @@ -530,76 +530,6 @@ gtkutil_entry_new (int max, GtkWidget * box, void *callback, return entry; } -GtkWidget * -gtkutil_clist_new (int columns, char *titles[], - GtkWidget * box, int policy, - void *select_callback, gpointer select_userdata, - void *unselect_callback, - gpointer unselect_userdata, int selection_mode) -{ - GtkWidget *clist, *win; - - win = gtk_scrolled_window_new (0, 0); - gtk_container_add (GTK_CONTAINER (box), win); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (win), - GTK_POLICY_AUTOMATIC, policy); - gtk_widget_show (win); - - if (titles) - clist = gtk_clist_new_with_titles (columns, titles); - else - clist = gtk_clist_new (columns); - - gtk_clist_set_selection_mode (GTK_CLIST (clist), selection_mode); - gtk_clist_column_titles_passive (GTK_CLIST (clist)); - gtk_container_add (GTK_CONTAINER (win), clist); - if (select_callback) - { - g_signal_connect (G_OBJECT (clist), "select_row", - G_CALLBACK (select_callback), select_userdata); - } - if (unselect_callback) - { - g_signal_connect (G_OBJECT (clist), "unselect_row", - G_CALLBACK (unselect_callback), unselect_userdata); - } - gtk_widget_show (clist); - - return clist; -} - -int -gtkutil_clist_selection (GtkWidget * clist) -{ - if (GTK_CLIST (clist)->selection) - return GPOINTER_TO_INT(GTK_CLIST (clist)->selection->data); - return -1; -} - -static int -int_compare (const int * elem1, const int * elem2) -{ - return (*elem1) - (*elem2); -} - -int -gtkutil_clist_multiple_selection (GtkWidget * clist, int ** rows, const int max_rows) -{ - int i = 0; - GList *tmp_clist; - *rows = malloc (sizeof (int) * max_rows ); - memset( *rows, -1, max_rows * sizeof(int) ); - - for( tmp_clist = GTK_CLIST(clist)->selection; - tmp_clist && i < max_rows; tmp_clist = tmp_clist->next, i++) - { - (*rows)[i] = GPOINTER_TO_INT( tmp_clist->data ); - } - qsort(*rows, i, sizeof(int), (void *)int_compare); - return i; - -} - void show_and_unfocus (GtkWidget * wid) { |