[gtkada] Problem with GtkAda
Tomas Hlavaty
hlavaty at labe.felk.cvut.cz
Wed Jun 20 11:17:14 CEST 2001
Hi,
I have a problem with Gtk.Glade package. It doesn't autoconect signals
when one call Gtk.Glade.Instantiate ("callbacks.glade"). I don't want to
generate Ada source from callbacks.glade file. I want only to define
callbacks in GtkAda.
Thanks
Tomas
--
Tomas Hlavaty mailto:hlavaty at labe.felk.cvut.cz
Department of Cybernetics http://labe.felk.cvut.cz/~hlavaty
Faculty of Electrical Engineering phone: (+420 2) 2435 7284
Czech Technical University
-------------- next part --------------
with Gui;
procedure Callbacks is
Gui_File: constant String := "callbacks.glade";
begin
Gui.Create (Gui_File);
end Callbacks;
-------------- next part --------------
with Gdk.Threads;
with Gtk.Main;
with Gtk.Glade;
with Gtk.Widget; use Gtk.Widget;
with Gtk.Util; use Gtk.Util;
with System;
package Gui is
procedure Quit (Object: in Private_Object;
Data: in System.Address);
procedure Load (Object: in Private_Object;
Data: in System.Address);
procedure Create (Gui_File: in String);
end Gui;
-------------- next part --------------
with Text_Io; use Text_Io;
package body Gui is
procedure Quit (Object: in Private_Object;
Data: in System.Address)
is
begin
Put_Line ("Callback: Quit.");
Gtk.Main.Gtk_Exit (0);
end Quit;
procedure Load (Object: in Private_Object;
Data: in System.Address)
is
begin
Put_Line ("Callback: Load.");
end Load;
procedure Create (Gui_File: in String)
is
begin
Gdk.Threads.Init;
Gtk.Main.Set_Locale;
Gtk.Main.Init;
Set_Signal ("quit", Quit'Access, System.Null_Address);
Set_Signal ("load", Load'Access, System.Null_Address);
Gtk.Glade.Instantiate (Gui_File);
Gdk.Threads.Enter;
Gtk.Main.Main;
Gdk.Threads.Leave;
end Create;
end Gui;
-------------- next part --------------
all:
gnatmake callbacks `gtkada-config`
clean:
rm -f b~*
rm -f *.ali *.o
rm -f *.BAK *.bak *~ core
cleanall: clean
rm -f callbacks
build: cleanall all
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/gtkada/attachments/20010620/77efb53b/attachment.htm
More information about the gtkada
mailing list