Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
41
Task/Window-creation/Ada/window-creation.ada
Normal file
41
Task/Window-creation/Ada/window-creation.ada
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
with Gtk.Window; use Gtk.Window;
|
||||
with Gtk.Widget; use Gtk.Widget;
|
||||
|
||||
with Gtk.Handlers;
|
||||
with Gtk.Main;
|
||||
|
||||
procedure Windowed_Application is
|
||||
Window : Gtk_Window;
|
||||
|
||||
package Handlers is new Gtk.Handlers.Callback (Gtk_Widget_Record);
|
||||
package Return_Handlers is
|
||||
new Gtk.Handlers.Return_Callback (Gtk_Widget_Record, Boolean);
|
||||
|
||||
function Delete_Event (Widget : access Gtk_Widget_Record'Class)
|
||||
return Boolean is
|
||||
begin
|
||||
return False;
|
||||
end Delete_Event;
|
||||
|
||||
procedure Destroy (Widget : access Gtk_Widget_Record'Class) is
|
||||
begin
|
||||
Gtk.Main.Main_Quit;
|
||||
end Destroy;
|
||||
|
||||
begin
|
||||
Gtk.Main.Init;
|
||||
Gtk.Window.Gtk_New (Window);
|
||||
Return_Handlers.Connect
|
||||
( Window,
|
||||
"delete_event",
|
||||
Return_Handlers.To_Marshaller (Delete_Event'Access)
|
||||
);
|
||||
Handlers.Connect
|
||||
( Window,
|
||||
"destroy",
|
||||
Handlers.To_Marshaller (Destroy'Access)
|
||||
);
|
||||
Show (Window);
|
||||
|
||||
Gtk.Main.Main;
|
||||
end Windowed_Application;
|
||||
Loading…
Add table
Add a link
Reference in a new issue