[gtkada] GNOME bindings?

Aidan Skinner aidan at velvet.net
Fri Mar 15 16:30:41 CET 2002


Is anybody else using the gnome-app_helper stuff? I reliably get
segfaults in gnome_stock_paint from create_menus when using the
UI_Info_Menu_*_Item functions to get stock items. This seems to be
related to the use of UI_Item_Configurable as the Item_Type in the
record, changing it to UI_Item means it doesn't segfault (but there's
no pixmap either).

I'm just wondering if I'm doing something stupid, or if there's
something that can be fixed.

Compile the sample code with:
gnatmake crash.adb `gtkada-config` `gnome-config --libs gnome gnomeui` -lgnomeada

and run the executable

with Gnome.App, Gnome.App_Helper; use Gnome.App, Gnome.App_Helper;
with Gtk.Main, Gtk.Widget, Gtk.Window; use Gtk.Window;
procedure Crash is
   Main_Window : Gnome.App.Gnome_App;
   File_Menu_Info : Gnome.App_Helper.UI_Info_Array_Access := new Gnome.App_Helper.UI_Info_Array(1..2);
   Menubar_Info : Gnome.App_Helper.UI_Info_Array_Access := new Gnome.App_Helper.UI_Info_Array(1..2);
begin
   Gtk.Main.Init;
   Gnome.App.Gnome_New (Main_Window, "Hello World", "Hello World");
   File_Menu_Info.all(1) := UI_Info_Menu_New_Window_Item(null);
   File_Menu_Info.all(2) := UI_Info_End;
   Menubar_Info.all(1) := UI_Info_Menu_File_Tree(File_Menu_Info);
   Menubar_Info.all(2) := UI_Info_End;
   Create_Menus(Main_Window, Menubar_Info); -- Segfaults here
   Show_All (Main_Window);
   Gtk.Main.Main;
end Crash;

- Aidan

-- 
aidan at velvet.net  http://www.velvet.net/~aidan/  aim:aidans42
finger for pgp key fingerprint: |-----------------------------
01AA 1594 2DB0 09E3 B850        | Money, honey. Cold cash is
C2D0 9A2C 4CC9 3EC4 75E1        | all that counts





More information about the gtkada mailing list