Thomas J Lewis wrote:
> 
> how's a gtkentry widget that's defined by a glade file initialized.
> 
> when the dialog window is called, the gtkentry text area needs to be
> initialized to some known, changing data.
> 
> the widget is defined local to the glade window file
> and the linker doesn't recognize gtkentry widget.
> 
> is there a macro or procedure that can be used to get to
> the gtkentry widget that's contained in a window
> so the text area can be initialized?
> 
> noticed in peter wright's book, beginning gtk+/gnome programming,
> page 450, there's a lookup_widget that look's like a fit.
> however,  didn't see it defined in book or in /usr/include/gtk.
> was this method replaced by some other method since book's printing?

Glade stores pointers to all the widgets and provides a lookup_widget()
function so you can get these pointers.


The FAQ (available at http://glade.gnome.org) describes this a bit:

4.5 How do I get a pointer to a widget from within a signal handler?

If you have a pointer to any widget in a window, you can get a pointer to
any other widget in the window using the lookup_widget() function that Glade
provides (in support.c).

You pass it a pointer to any widget in a window, and the name of the widget
that you want to get. Usually in signal handlers you can use the first argument
to the signal handler as the first parameter to lookup_widget(), e.g.

void
on_button1_clicked                     (GtkButton       *button,
                                        gpointer         user_data)
{
  GtkWidget *entry1;

  entry1 = lookup_widget (GTK_WIDGET (button), "entry1");

  ...
}


Damon

_______________________________________________
Glade-devel maillist  -  [EMAIL PROTECTED]
http://lists.helixcode.com/mailman/listinfo/glade-devel

Reply via email to