comparison gtk/dw.c @ 164:d35771f70bdd

Allow tree-select to work on container controls.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 17 Nov 2002 13:00:37 +0000
parents 0322836c5299
children d03716228b7f
comparison
equal deleted inserted replaced
163:0322836c5299 164:d35771f70bdd
539 gtk_object_set_data(GTK_OBJECT(widget), "selectlist", tmp); 539 gtk_object_set_data(GTK_OBJECT(widget), "selectlist", tmp);
540 } 540 }
541 return FALSE; 541 return FALSE;
542 } 542 }
543 543
544 gint _container_select_row(GtkWidget *widget, gint row, gint column, GdkEventButton *event, gpointer data)
545 {
546 SignalHandler *work = (SignalHandler *)data;
547 char *rowdata = gtk_clist_get_row_data(GTK_CLIST(widget), row);
548 int (*contextfunc)(HWND, char *, void *) = work->func;
549
550 return contextfunc(work->window, rowdata, work->data);;
551 }
552
544 gint _unselect_row(GtkWidget *widget, gint row, gint column, GdkEventButton *event, gpointer data) 553 gint _unselect_row(GtkWidget *widget, gint row, gint column, GdkEventButton *event, gpointer data)
545 { 554 {
546 GList *tmp; 555 GList *tmp;
547 char *rowdata; 556 char *rowdata;
548 557
5006 5015
5007 *handle = dlopen(newname, RTLD_NOW); 5016 *handle = dlopen(newname, RTLD_NOW);
5008 if(*handle == NULL) 5017 if(*handle == NULL)
5009 { 5018 {
5010 strncpy(errorbuf, dlerror(), 1024); 5019 strncpy(errorbuf, dlerror(), 1024);
5020 printf("%s\n", errorbuf);
5011 sprintf(newname, "lib%s.so", name); 5021 sprintf(newname, "lib%s.so", name);
5012 *handle = dlopen(newname, RTLD_NOW); 5022 *handle = dlopen(newname, RTLD_NOW);
5013 } 5023 }
5014 5024
5015 free(newname); 5025 free(newname);
6965 else if(GTK_IS_CLIST(thiswindow) && strcmp(signame, "container-select") == 0) 6975 else if(GTK_IS_CLIST(thiswindow) && strcmp(signame, "container-select") == 0)
6966 { 6976 {
6967 thisname = "button_press_event"; 6977 thisname = "button_press_event";
6968 thisfunc = _findsigfunc("container-select"); 6978 thisfunc = _findsigfunc("container-select");
6969 } 6979 }
6980 else if(GTK_IS_CLIST(thiswindow) && strcmp(signame, "tree-select") == 0)
6981 {
6982 thisname = "select_row";
6983 thisfunc = (void *)_container_select_row;
6984 }
6970 else if(GTK_IS_COMBO(thiswindow) && strcmp(signame, "item-select") == 0) 6985 else if(GTK_IS_COMBO(thiswindow) && strcmp(signame, "item-select") == 0)
6971 { 6986 {
6972 thisname = "select_child"; 6987 thisname = "select_child";
6973 thiswindow = GTK_COMBO(thiswindow)->list; 6988 thiswindow = GTK_COMBO(thiswindow)->list;
6974 } 6989 }