summaryrefslogtreecommitdiff
path: root/src/windows.adb
blob: bf070a480a00c62d5918d03f9371d9676d0a3128 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43


with FLTK.Widgets;
with FLTK.Widgets.Groups;
with FLTK.Widgets.Groups.Windows;


package body Windows is


    package W  renames FLTK.Widgets;
    package G  renames FLTK.Widgets.Groups;
    package WN renames FLTK.Widgets.Groups.Windows;




    --  used to hide about/find/replace/etc windows instead
    --  of constantly creating and destroying them

    procedure Hide_CB
           (Item : in out W.Widget'Class)
    is
        P : access G.Group'Class;
    begin
        if Item in WN.Window'Class then
            WN.Window (Item).Hide;
        else
            P := Item.Parent;
            loop
                if P = null then
                    return;
                end if;
                exit when P.all in WN.Window'Class;
                P := P.Parent;
            end loop;
            WN.Window (P.all).Hide;
        end if;
    end Hide_CB;


end Windows;