with glade-2 I've created an application which should show translated data into a clist. Therefore I use several buttons to control the clist. One of them is the start/stop button and a clear button. When the start/stop is pushed I want to write some text ("Hello World") into the clist. Currently I want to do this directly by the start-stop-function. In the future, the start-stop function reveices and translate the data to text.
I think that there's a problem using the g_signal_connect functions. I'm not sure.
The code produced by glade:
GtkWidget* create_main_window (void)
startstop = gtk_label_new_with_mnemonic (_("Start\nStop"));
gtk_box_pack_start (GTK_BOX (hbox21), startstop, FALSE, FALSE, 3);
clist1 = gtk_clist_new (9);
gtk_container_add (GTK_CONTAINER (scrolledwindow2), clist1);
...several clist options here...
g_signal_connect ((gpointer) startstop, "clicked",
g_signal_connect_swapped ((gpointer) clr, "clicked",
GLADE_HOOKUP_OBJECT (main_window, clist1, "clist1"); // ?????
void on_start_stop_clicked (GtkButton *button, gpointer user_data)
gtk_clist_set_text((GtkCList*)user_data, 1, 1, "Hello World");
void on_clr_clicked(GtkButton *button, gpointer user_data)
The messages I receive when the program is running in a terminal window are:
(prog:22717): Gtk-CRITICAL **: file gtkclist.c: line 2243 (gtk_clist_set_text): assertion `GTK_IS_CLIST (clist)' failed
(prog:22717): Gtk-CRITICAL **: file gtkclist.c: line 2701 (gtk_clist_clear): assertion `GTK_IS_CLIST (clist)' failed
How can I solve this???????