Created
January 19, 2012 16:17
-
-
Save pdobrowolski/1640922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Window_Package; use Window_Package; | |
with Text_IO; use Text_IO; | |
with Glib.Error; use Glib.Error; | |
with Glib.Object; use Glib.Object; | |
with Gtk.Main; | |
with Gtk.Widget; | |
with Gtk.Window; use Gtk.Window; | |
with Gtkada.Builder; use Gtkada.Builder; | |
procedure Window is | |
Builder : Gtkada_Builder; | |
Error : GError; | |
Default_Filename : constant String := "ChatWindow.glade"; | |
begin | |
Gtk.Main.Init; | |
Gtk_New (Builder); | |
Error := Add_From_File (Builder, Default_Filename); | |
if Error /= null then | |
Put_Line ("Error: " & Get_Message(Error)); | |
Error_Free (Error); | |
end if; | |
Register_Handler ( | |
Builder => Builder, | |
Handler_Name => "on_window_destroy", | |
Handler => Destroy'Access); | |
Gtk.Widget.Show_All ( | |
Gtk.Widget.Convert ( | |
Glib.Object.Convert ( | |
Get_Object (Builder, "window")))); | |
Gtk.Main.Main; | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package body Window_Package is | |
procedure Destroy (Widget : access Gtk_Widget_Record'Class) is | |
pragma Unreferenced (Widget); | |
begin | |
Gtk.Main.Main_Quit; | |
end Destroy; | |
end Window_Package; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Gtk.Widget; use Gtk.Widget; | |
package Window_Package is | |
procedure Destroy (Widget : access Gtk_Widget_Record'Class); | |
end Window_Package; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment