File: banner.adb

package info (click to toggle)
libgtkada 2.24.4dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 12,208 kB
  • ctags: 1,676
  • sloc: ada: 119,686; ansic: 4,719; sh: 3,003; makefile: 690; xml: 338; perl: 70
file content (28 lines) | stat: -rw-r--r-- 712 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--  This example shows how you can display a banner while your application is
--  loading

with Gtk.Window, Gtk.Enums, Gtk.Main, Gtk.Label;
use Gtk.Window,  Gtk.Enums, Gtk.Main, Gtk.Label;

procedure Banner is
   Win   : Gtk_Window;
   Label : Gtk_Label;
begin
   Gtk.Main.Init;

   Gtk_New (Win, Window_Popup);
   Set_Policy (Win,
               Allow_Shrink => False,
               Allow_Grow   => False,
               Auto_Shrink  => False);
   Set_Position (Win, Win_Pos_Center);
   Set_Size_Request (Win, 300, 300);

   Gtk_New (Label,
       "You should show a pixmap instead..."
       & ASCII.LF & "(ctrl-c in terminal to exit)");
   Add (Win, Label);

   Show_All (Win);
   Gtk.Main.Main;
end Banner;