how to access a widget ?
- From: edward hage <edha xs4all nl>
- To: gtk-list gnome org
- Subject: how to access a widget ?
- Date: Mon, 30 Aug 2004 00:54:39 +0200
Hello,
I have made a program which shows a table with buttons, created like this
..........
for (i=0; i < vertical - 1; i++)
{ ............. etc.
  ...........etc. ....etc.......
 for (j=1; j < vertical; j++)
 {
   if (i < j)
   {
    button = gtk_button_new ();
    gtk_button_set_label ( (GtkButton *) button , " ");
    gtk_table_attach_defaults (GTK_TABLE (table), button , 1 + j, 2 + j, 1 + i, 2 + i);
    g_signal_connect (GTK_OBJECT(button), "clicked", (GCallback) toggle_location_event, 
GINT_TO_POINTER (sum(i)+j));
   }
 }
.....etc............
}
I have a call-back function toggle_location_event which can change the text of the button 
which is pressed.
Now I also want to change the text of a button that is not pressed ( in 
toggle_location_event). I know the location i and j of that button, but I don't know how 
to change the text because I don't have the object-name myself (because I use  button = 
gtk_button_new () lots of times to create more widgets which don't have unique names).
How can I retrieve the widget from the known location so I can change the text on the button ?
Thanks in advance, Edward
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]