[gtkada] Newbie question: Glade-2 and child widget access

Leonardo Cecchi leonardoce at interfree.it
Thu Dec 30 16:58:16 CET 2004


Manuel, thanks for the reply and for the really good idea.
To access the child widgets I have to convert the Gtk.Widget type to my specific type.
I have some problems in the convertion.

For example if I put the line:

	Put_Line(Ada.Tags.Expanded_Name( Get_Toplevel(Object)'Tag   ));

in a callback from a Gtk.Image_Menu_Item I obtain this output:

	GTK.WINDOW.GTK_WINDOW_RECORD

and I can't convert to my window type.
If I put the code line on a Gtk.Button callback I obtain this output:

	FINESTRA_PRINCIPALE_PKG.FINESTRA_PRINCIPALE_RECORD

and I can convert because this is the type I want.
On the button all is perfect and I can work with child widget.
The problem is on the menu item.
Why this strange behavior? All the widget are in the same window......

Thanks,

Leonardo



On Thu, 30 Dec 2004 13:12:03 +0100
"Manuel Op de Coul" <manuel.op.de.coul at eon-benelux.com> wrote:

> 
> Leonardo,
> 
> I would leave the generated code as it is. In your callbacks you can
> get the toplevel widget (i.e. the dialog) from the Object parameter
> with functions in Gtk.Widget, like Get_Toplevel, Get_Ancestor or
> Get_Parent.
> 
> Manuel
> 
> 



More information about the gtkada mailing list