[Glade-users] glade2 and gtkada

Nicolas Setton setton at adacore.com
Wed Oct 26 04:08:51 EDT 2011


> I am simply trying to modify some label texts from with a callback.
> 
> Basically I want (in pseudo code):
> 
> on button1 click
> set_text(label1, "text");
> 
> 
> The problem is that label1 is not in scope when I'm in the handler (it's
> in a seperate package). I believe I need the call lookup_widget() but I
> cannot find this anywhere within GtkAda, upon searching the net I can only
> find this as a C call not Ada.
> 
> Is there an equivalent in Ada or do I have a fundamental misunderstanding
> of my problem.

label1 should be a field of your toplevel widget (window or dialog), so you'll be able to work by using object_connect and passing your toplevel widget - and in the callback, convert the parameter to your widget and access the field directly.

Also, note that recent versions of GtkAda support glade3/gtkbuilder.

Nicolas


More information about the Glade-users mailing list