9 w = Test.currentWidget()
10 w.create_oval(50, 50, 150, 100, fill = 'red')
11 w.create_oval(100, 50, 150, 150, fill = 'blue')
12 w.create_oval(50, 100, 200, 350, fill = 'yellow')
15 w = Test.currentWidget()
16 lb = Pmw.ScrolledListBox(w.interior(),
17 items = range(20), listbox_height = 6)
18 w.create_window(300, 100, window = lb)
20 def _testYView(doBottom):
21 w = Test.currentWidget()
22 top, bottom = w.yview()
23 if type(top) != type(0.0) or type(bottom) != type(0.0):
24 return 'bad type ' + str(top) + ' ' + str(bottom)
27 return 'bottom is ' + str(bottom)
30 return 'top is ' + str(top)
32 kw_1 = {'labelpos': 'n', 'label_text': 'ScrolledCanvas', 'borderframe' : 1}
34 (c.pack, (), {'padx' : 10, 'pady' : 10, 'fill' : 'both', 'expand' : 1}),
35 (Test.num_options, (), 8),
37 (c.resizescrollregion, ()),
39 (c.resizescrollregion, ()),
40 ('hull_background', 'aliceblue'),
41 ('Scrollbar_borderwidth', 3),
42 ('hull_cursor', 'gumby'),
43 ('label_text', 'Label'),
44 ('Scrollbar_repeatdelay', 200),
45 ('Scrollbar_repeatinterval', 105),
46 ('vscrollmode', 'none'),
47 ('vscrollmode', 'static'),
48 ('vscrollmode', 'dynamic'),
49 ('hscrollmode', 'none'),
50 ('hscrollmode', 'static'),
51 ('hscrollmode', 'dynamic'),
52 ('Scrollbar_width', 20),
53 ('vscrollmode', 'bogus', 'ValueError: bad vscrollmode ' +
54 'option "bogus": should be static, dynamic, or none'),
55 ('hscrollmode', 'bogus', 'ValueError: bad hscrollmode ' +
56 'option "bogus": should be static, dynamic, or none'),
57 (c.yview, ('moveto', 0.0)),
59 (c.yview, ('moveto', 0.02)),
60 (c.yview, ('moveto', 0.04)),
61 (c.yview, ('moveto', 0.06)),
62 (c.yview, ('moveto', 0.08)),
63 (c.yview, ('moveto', 0.10)),
64 (c.yview, ('moveto', 0.12)),
65 (c.yview, ('moveto', 0.14)),
66 (c.yview, ('moveto', 0.16)),
67 (c.yview, ('moveto', 0.18)),
68 (c.yview, ('moveto', 0.20)),
69 (c.yview, ('moveto', 0.22)),
70 (c.yview, ('moveto', 0.24)),
71 (c.yview, ('moveto', 0.26)),
72 (c.yview, ('moveto', 0.28)),
73 (c.yview, ('moveto', 0.98)),
75 (c.yview, ('scroll', -1, 'page')),
76 (c.yview, ('scroll', -1, 'page')),
78 (c.yview, ('scroll', 1, 'page')),
79 (c.yview, ('scroll', 1, 'page')),
84 'hscrollmode' : 'dynamic',
85 'label_text' : 'Label',
94 (c.pack, (), {'padx' : 10, 'pady' : 10, 'fill' : 'both', 'expand' : 1}),
102 testData = ((Pmw.ScrolledCanvas, alltests),)
104 if __name__ == '__main__':
105 Test.runTests(testData)