blob: c7eabfe1e37182e0c338c67a0516911449497c27 (
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
|
# Test to see if we can create a new panel.
appExtend {
*test_objects:\
toplevel TopLevelShell testPanel\
testPanel Form testForm\
testForm Label testLabel\
testForm Command testQuit
*testPanel.geometry: 250x40
*testLabel.label: Hello, world!
*testQuit.fromHoriz: testLabel
*testQuit.label: Quit
}
createObjects test_objects
#------------------------------------------------------------------------------
# Test to see if we can add a widget to an existing widget tree, i.e. create
# a widget and assign an existing parent. Try adding a new button to the
# ximtool panelbar.
appExtend {
*par_objects:\
panelbar Toggle pbTest
*pbTest.label: TESTING
}
createObjects par_objects
# change the layout to include the new widget.
#send panelbar unmap
send panelbar set layout "horizontal \{ \
pbTest < +inf -inf * > 1 < -1 > \
pbDisplayP < +inf -inf * > 1 < -1 > \
pbPrintP < +inf -inf * > 1 < -1 > \
pbLoadP < +inf -inf * > 1 < -1 > \
pbSaveP < +inf -inf * > 1 < -1 > \
pbInfoP < +inf -inf * > 1 < -1 > \
pbTileP < +inf -inf * > 1 < -1 > \
pbCoordP < +inf -inf * > 1 < -1 > \
pbPanM < +inf -inf * > 1 < -1 > \
pbMagM < +inf -inf * > 1 < -1 > \
pbWcsM < +inf -inf * > 1 < -1 > \
pbIsm < +inf -inf * > 1 < -1 > \
helpButton < +inf -inf * > 1 < -1 > \
pbQuit < +inf -inf * > 1 < -1 > \
\}"
#send panelbar map
# Do the callbacks
proc testToggle { widget type state args } \
{
if {$state} { send testPanel map } else { send testPanel unmap }
} ; send pbTest addCallback testToggle
send testQuit addCallback "send testPanel unmap; send pbTest set state False"
|