Re: Label on a button




 Thanks again,

  Read my email with subject:  Label on a button - a bit more complicated. ( If
you can :)

  I understand what you are saying, but the label is not on the button at all.
I do get a reference to the button, but the label is set on something called
GtkToolbarChild.

  Now I am trying to use :  

  GtkWidget* parent = button->parent;
  GtkWidget* label = parent->label;

  It is not working, so I think that the button parent is not really set to the
GtkToolbarChild.

  Thanks again for your time and effort. I do really appreciate.

HArring
  
--- Luciano Chavez <lnx1138 us ibm com> wrote:
Harring,

I've played with Glade 0.6.4 and not sure what option does it but the
generated code for a widget in a window might look like this:

  button = gtk_button_new ();
  gtk_widget_set_name (button, "button");
  gtk_widget_ref (button);
  gtk_object_set_data_full (GTK_OBJECT (about_window), "button", button,
                            (GtkDestroyNotify) gtk_widget_unref);


As you can see it uses the gtk_object_set_data_full() to store the
button widget id with the name as the key. 

You would then only need the window id to retrieve with the same key.

button = gtk_object_get_data (GTK_OBJECT (about_window), "button");

This is different that the set_name. Sorry for the confusion.

-- 
regards,

Luciano Chavez

lnx1138 us ibm com          
http://evms.sourceforge.net



__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com



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