[Glade-users] Probably a stuipd question

Damon Chaplin damon@helixcode.com
Mon, 23 Oct 2000 23:11:44 +0100


Jason J Roberts wrote:
> 
> I want to adjust a listbox on the fly. The list is part of a dialog box
> created with Glade and I'm unsure of how to get access to the list
> widget without changing the interface.c code. Thanks in advance for the
> help!

In the FAQ:

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

Use the lookup_widget() function provided. (It can be found 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