Re: Newbie: How to access a window's widgets?




 Glade generates a function int the file support.c with the signature
 GtkWidget* lookup_widget(GtkWidget* parent, const char* name);

 You pass the "parent" widget -- this is most likely your main window, and the
name of the widget you want a pointer to (The name can be set on glade -
otherwise glades automatically names them with names such as button1, gtkcombo2
and so on.) The return value is the widget you want.

 It helps to keep a static variable to the parent widget on the file you want
to access the other widgets.

Hope this helps.



--- Neoklis Kyriazis <neoklis users sourceforge net> wrote:
Hi all,

I am taking my first steps writing a GTK app and I am using glade. This
has produced amongst others the interface.c file with a function to
create the top window with all its widgets, and a main.c where the top
window is declared and creatred.

I would like to know how I should access the widgets of the top window,
for example to get or set text in entry widgets, either in the main.c
function or other functions in my own files.

Please forgive me for asking a silly question!

My thanks in advance.

-- 
Regards      My Ham Radio callsign: 5B4AZ  QTH Loc: KM64MR
             My website (with some Ham Radio/Linux software):
Neoklis      http://www.qsl.net/5b4az/
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



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