In legion build config, updated path to GNU tools and updated deprecated Sun CC flag...
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v8plus / lib / python2.4 / site-packages / Pmw / Pmw_1_2 / tests / OptionMenu_test.py
CommitLineData
920dae64
AT
1import Tkinter
2import Test
3import Pmw
4
5Test.initialise()
6
7c = Pmw.OptionMenu
8
9kw_1 = {
10 'labelpos' : 'nw',
11 'label_text' : 'Option Menu:',
12 'items' : ('Chips', 'Lollies', 'Junk', 'More junk'),
13 'initialitem' : 1,
14}
15tests_1 = (
16 (c.pack, (), {'padx' : 10, 'pady' : 10, 'fill' : 'both', 'expand' : 1}),
17 (Test.num_options, (), 6),
18 (c.getcurselection, (), 'Lollies'),
19 (c.index, 'Junk', 2),
20 (c.index, 'Nowhere', 'ValueError: bad index "Nowhere": must be ' +
21 'a name, a number, Pmw.END or Pmw.SELECT'),
22 (c.index, Pmw.END, 3),
23 (c.index, Pmw.SELECT, 1),
24 (c.index, 1, 1),
25 (c.invoke, 'Chips'),
26 (c.getcurselection, (), 'Chips'),
27 ('command', Test.callback1),
28 (c.invoke, (), 'Chips'),
29 (c.invoke, 'Lollies', 'Lollies'),
30 (c.getcurselection, (), 'Lollies'),
31 ('hull_background', 'yellow'),
32 ('hull_show', 'X', 'TclError: unknown option "-show"'),
33 (c.index, Pmw.SELECT, 1),
34 (c.setitems, (('Chips', 'Junk', 'Lollies', 'More junk'),)),
35 (c.index, Pmw.SELECT, 2),
36 (c.setitems, (('Fruit', 'Vegetables', 'Cereals', 'Legumes'),)),
37 (c.index, Pmw.SELECT, 0),
38 (c.getcurselection, (), 'Fruit'),
39 (c.setitems, (('Vegetables', 'Cereals', 'Legumes'), Pmw.END)),
40 (c.getcurselection, (), 'Legumes'),
41 (c.index, 'Vegetables', 0),
42 (c.invoke, 'Legumes', 'Legumes'),
43 ('hull_cursor', 'gumby'),
44 ('label_foreground', 'Green'),
45 ('label_foreground', 'Black'),
46 ('label_highlightcolor', 'Red'),
47 ('label_text', 'Label'),
48)
49
50testData = ((c, ((tests_1, kw_1),)),)
51
52if __name__ == '__main__':
53 Test.runTests(testData)