[gtkada] gsignal.c error during button signal connection

Roger Hancock roger_hancock at hotmail.com
Sun Aug 24 05:25:00 CEST 2003


Does anyone know why I get the following runtime error when I connect a 
signal handler to a button:

GLib-GObject-CRITICAL **: file gsignal.c: line 1745 
(g_signal_connect_closure_by_id): assertion `signal_id > 0' failed

I am using Windows XP, GtkAda 2.2.0, and GNAT 3.15p at the moment but I have 
seen the same message on Redhat Linux 8.0.  A simple program for creating 
the problem follows.  Thanks.

with Text_Io; use Text_Io;
with Gtk.Main;
with Gtk.Window; use Gtk.Window;
with Gtk.Button; use Gtk.Button;
with Gtk.Handlers;

procedure Test is
   Win : Gtk_Window;
   Button : Gtk_Button;
   package Button_Callback is new Gtk.Handlers.Callback
     (Widget_Type => Gtk_Button_Record);
   procedure Freeze_Handler(Button : access Gtk_Button_Record'Class) is
   begin
      Put_Line("Got click");
   end;
begin
   Gtk.Main.Set_Locale;
   Gtk.Main.Init;
   Gtk_New(Win);
   Gtk_New(Button,"Hello");
   Button_Callback.Connect(Button,
                           "Clicked",
                           Button_Callback.
                           To_Marshaller(Freeze_Handler'Access));
   Add(Win,Button);
   Show_All(Win);
   Gtk.Main.Main;
end;

_________________________________________________________________
Get MSN 8 and help protect your children with advanced parental controls.  
http://join.msn.com/?page=features/parental




More information about the gtkada mailing list