aboutsummaryrefslogtreecommitdiff
path: root/vendor/x11iraf/ximtool/gui.bak/boot.tcl
blob: 936273a50b1fea6c0dbbdc43aa715f5f994b8b51 (plain) (blame)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74


################################################################################
#  GUI Bootstrap Procedures
################################################################################

# Initialize the widget tree.
proc InitWidgetTree args \
{
    global Objects Resources Version


    # Add a new objects description for each of the panels found so we can
    # create them by name later rather that with the defaults.

    set guiResources ""
    foreach obj [array names Objects] {
	set guiResources \
		[ format "%s\n\n*%s_objects:%s\n" \
		    $guiResources $obj $Objects($obj) ]
    }

    # Now append all the Resource strings, changing any version strings as
    # needed.

    foreach res [array names Resources] {
	regsub -all XIMTOOL_VERSION $Resources($res) $Version ver
	set guiResources [ format "%s\n\n%s\n\n" $guiResources $ver ]
    }

    # Define all of the GUI objects and resources.
    appInitialize ximtool XImtool $guiResources
}


# Realize a window module, i.e. create it's objects.
proc Realize { module args } \
{
    global Objects

    # Create any widgets for the module.  We only do this once and set a
    # flag to indicate the objects have been created so we don't do it on
    # subsequent realizations.
    if { [info exists Objects($module)] } {
	createObjects [format "%s_objects" $module]
	reset-server
    }
}


# Bootstrap up the GUI.
InitWidgetTree
Realize ximtool
Realize parameters
Realize panelShell
Realize tcl_panel
Realize pixel_table
Realize hdr_panel
Realize blink_panel
Realize help_panel
Realize xpan_panel
Realize xmag_panel
Realize warning

reset-server

# Set the gterm widget focus.
send colorbar setGterm ; send colorbar activate
send imagewin setGterm ; send imagewin activate

# Crank it up.
activate