Re: name -> widget func?



To get a specific widget, say in a window with other 300
widgets, use set_data/get_data functions, as in the following example:

when you create the button:
gtk_object_set_data (GTK_OBJECT (window), "my_button", button);

when you want it back:
button = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (window), "my_button");

Carlos


What if you wanted to use in integer instead of "my_button" in each case?
like:
for(i=0;i<count;i++)
button[i] = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (window), i );

George

----- End of forwarded message from Carlos Pereira -----




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]