[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Accessing widgets in a property box
- From: Gustavo Joćo Alves Marques Carneiro <ee96090 fe up pt>
- To: GTK Help <gtk-app-devel-list redhat com>
- Subject: Re: Accessing widgets in a property box
- Date: Thu, 24 Feb 2000 00:25:19 +0000 (WET)
On Thu, 24 Feb 2000, Jeff W. wrote:
> in a property box, how would I access the various widgets I have there,
> from within the apply function that is triggered when the user clicks
> the button? Maybe something like:
> get_text(PropertyBoxName->widgetName)??????
>
Maybe you should consider using libglade for such kind of
work. With libglade you can get a widget by its name with:
glade_xml_get_widget (xml, "widget name");
Without using libglade, the best way is to do a
gtk_object_set_data (GTK_OBJECT (dialog), "name", widget); for all
widgets. In the callback
void callback (GtkWidget *some_button)
{
GtkWidget *dialog, *wid1, *wid2...;
dialog = gtk_widget_get_toplevel (dialog);
wid1 = gtk_object_get_data (GTK_OBJECT (dialog), "wid1 name");
wid2 = gtk_object_get_data (GTK_OBJECT (dialog), "wid2 name");
...
}
Of course, there are more ways of doing it.
--
Gustavo J.A.M. Carneiro
[reinolinux.fe.up.pt/~ee96090]
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]