B
bnrj.rudra
Dear Friends,
This is a question on GTK, but failed to find a forum on that. Since GTK is based on C, posting here with fingers crossed.
I have taken a project (my own, not homework) to develop a table. I
generally work with fortran, dont know C that much.
What I want is a gtk clist to pop up when I press a button, via
callback. The button widget in my code is
/* Create first button */
button = gtk_button_new_with_label ("B1");
/* When the button is clicked, we call the "callback" function
* with a pointer to "button 1" as its argument */
g_signal_connect (button, "clicked",
G_CALLBACK (callback), (gpointer) "B1");
/* Insert button 1 into the upper left quadrant of the table */
gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 0, 1);
gtk_widget_show (button);
The definations are mostly based on
http://developer.gnome.org/gtk-tutorial/2.24/x344.html
What I want to do is callback to execute another gtk file(a clist),
rather than what shown in the example
Code:
static void callback( GtkWidget *widget,
gpointer data ) {
g_print ("Hello again - %s was pressed\n", (gchar *) data);
}
Can you please show me how I can get this?
This is a question on GTK, but failed to find a forum on that. Since GTK is based on C, posting here with fingers crossed.
I have taken a project (my own, not homework) to develop a table. I
generally work with fortran, dont know C that much.
What I want is a gtk clist to pop up when I press a button, via
callback. The button widget in my code is
/* Create first button */
button = gtk_button_new_with_label ("B1");
/* When the button is clicked, we call the "callback" function
* with a pointer to "button 1" as its argument */
g_signal_connect (button, "clicked",
G_CALLBACK (callback), (gpointer) "B1");
/* Insert button 1 into the upper left quadrant of the table */
gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 0, 1);
gtk_widget_show (button);
The definations are mostly based on
http://developer.gnome.org/gtk-tutorial/2.24/x344.html
What I want to do is callback to execute another gtk file(a clist),
rather than what shown in the example
Code:
static void callback( GtkWidget *widget,
gpointer data ) {
g_print ("Hello again - %s was pressed\n", (gchar *) data);
}
Can you please show me how I can get this?