[gtkada] access check failed

Matthias Teege matthias-gtkada at mteege.de
Sat Sep 4 09:08:08 CEST 2004


Moin,

I'm playing with gtk ada and try to integrate some code borrowd from
another gtkada project. The code push messages to the statusbar. It
looks like that:

procedure call_statusbar (text : in string)
is
     my_id   : context_ID := Get_Context_ID(Window1.statusbar1,"Hallo");
     message : message_ID;
begin
     message := Push(Window1.statusbar1,my_id,text);
end call_statusbar;

Now I try to use this procedure in callback procedure:

   procedure On_Combo5_Realize
     (Object  : access Gtk_Combo_Record'Class;
      Params  : Gtk.Arguments.Gtk_Args;
      Window1 : Window1_Access)
   is
      Combo_Items : String_List.Glist;
   begin
      Gadra.Fill_Combo(Window1.Connection.ALL, Combo_Items,"mdt","lnd");
      Combo.Set_Popdown_Strings (Window1.Combo5, Combo_Items);
      Free_String_List (Combo_Items);
      Call_Statusbar("Hello");
   end On_Combo5_Realize;

The code compiles but if I try to run it, it gives me

./window1

(window1:5678): Gtk-WARNING **: Invalid input string
*** NOTICE : WARNING:  there is no transaction in progress

raised CONSTRAINT_ERROR : window1_pkg.ads:142 access check failed

window1_pkg.ads:142 looks like that

....
      Label4 : Gtk_Label;
      Statusbar1 : Gtk_Statusbar;
      Connection : Connection_Access;
   end record;
   type Window1_Access is access all Window1_Record'Class;

   procedure Gtk_New (Window1 : out Window1_Access);
   procedure Initialize (Window1 : access Window1_Record'Class);

L142->   Window1 : Window1_Access;
end Window1_Pkg;

What is the "access check" and why does it fail?

Thanks
Matthias

-- 
make world not war




More information about the gtkada mailing list