[gtkada] pb : conversion (cast) of widget

Emmanuel Briot briot at adacore.com
Tue Jan 23 11:00:40 CET 2007


On Tuesday 23 January 2007 10:53, Annie.Culet wrote:
> I have a conversion problem with others like Text_View.  When I do
> text_view_name : Gtk_Text_view;
> text_view_name := Gtk_Text_View (Get_Widget (XML,-"myWidgetName"));
> I get a :  tag check failed .
>
> So I put a pragma suppress (All_Checks) , and now
> I get a : stack overflow

Have a look at the package gtk-type_conversion.ads, which you need to "with" 
in your project for the above to work.
Generally speaking, it is probably better and more efficient to store a direct 
instance of your widget into another one rather than access it by name, if 
you can:

    type My_Window_Record is new Gtk_Window_Record with record
        XML : Gtk_Text_View;
    end record;
...

Emmanuel



More information about the gtkada mailing list