[gtkada] Porting gate to glade2
Preben Randhol
randhol at pvv.org
Thu Apr 17 18:07:28 CEST 2003
Now gate parses GtkWindow and Gtk[V|H]Box [*]. Used most of the time
yesterday to get the source code to be approved by the style guide. But
I also got a problem when trying to fix the GtkLabel generation, but I
then get an errer from gobject. The output of gate is below. Do you know
why this error happens? It happens when Misc_Generate (N, File); is
called in procedure Label_Generate (N : Node_Ptr; File : File_Type)
in gtk_generation.adb.
The error is:
(gate:19072): GLib-GObject-WARNING **: cannot create instance of abstract (non-instantiatable) type `GtkMisc'
raised STORAGE_ERROR : stack overflow (or erroneous memory access)
Is the GtkMisc removed from GtkAda-2.0 ? There is no info of it in the
docs.
Any help much appreciated.
[*] Need to add the new whistles and bells of GtkAda-2.0 though.
-------------------------------------------------------------------
% gate prosjekt12.glade
with Gtk; use Gtk;
with Gtk; use Gtk;
with Gtk.Main;
with Gtk.Widget; use Gtk.Widget;
with Window1_Pkg; use Window1_Pkg;
procedure Window1 is
Window1 : Window1_Access;
begin
Gtk.Main.Set_Locale;
Gtk.Main.Init;
Gtk_New (Window1);
Show_All (Window1);
Gtk.Main.Main;
end Window1;
package Window1_Pkg is
type Window1_Record is new Gtk_Window_Record with record
Vbox1 : Gtk_Vbox;
Label1 : Gtk_Label;
end record;
type Window1_Access is access Window1_Record'Class;
procedure Gtk_New (Window1 : out Window1_Access);
procedure Initialize (Window1 : access Window1_Record'Class);
end Window1_Pkg;
-----------------------------------------
with Glib; use Glib;
with Gtk; use Gtk;
with Gdk.Types; use Gdk.Types;
with Gtk.Widget; use Gtk.Widget;
with Gtk.Enums; use Gtk.Enums;
with Gtkada.Handlers; use Gtkada.Handlers;
with Callbacks_Prosjekt12; use Callbacks_Prosjekt12;
with Prosjekt12_Intl; use Prosjekt12_Intl;
package body Window1_Pkg is
procedure Gtk_New (Window1 : out Window1_Access) is
begin
Window1 := new Window1_Record;
Window1_Pkg.Initialize (Window1);
end Gtk_New;
procedure Initialize (Window1 : access Window1_Record'Class) is
begin
Gtk.Window.Initialize (Window1, Window_Toplevel);
-- ###dBUG: Gettext widget => yes
Set_Title (Window1, -"window1");
Set_Modal (Window1, False);
Gtk_New_Vbox (Window1.Vbox1, False, 0);
-- ###dBUG: Gettext widget => yes
Gtk_New (Window1.Label1, -("label1 Preben"));
(gate:19072): GLib-GObject-WARNING **: cannot create instance of abstract (non-instantiatable) type `GtkMisc'
raised STORAGE_ERROR : stack overflow (or erroneous memory access)
--
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
«For me, Ada95 puts back the joy in programming.»
More information about the gtkada
mailing list