53a5ab48cd4d88423fa6d1f6a06d2c0fee94e04e
# Based on iwidgets2.2.0/tests/scrolledtext.test code.
def _testYView(doBottom
):
if type(top
) != type(0.0) or type(bottom
) != type(0.0):
return 'bad type ' + str(top
) + ' ' + str(bottom
)
return 'bottom is ' + str(bottom
)
return 'top is ' + str(top
)
kw_1
= {'labelpos': 'n', 'label_text': 'ScrolledText'}
(c
.pack
, (), {'padx' : 10, 'pady' : 10, 'fill' : 'both', 'expand' : 1}),
(Test
.num_options
, (), 10),
(c
.importfile
, 'ScrolledText_test.py'),
('hull_background', 'aliceblue'),
('Scrollbar_borderwidth', 3),
('hull_cursor', 'gumby'),
('text_exportselection', 0),
('text_exportselection', 1),
('text_foreground', 'Black'),
('text_insertbackground', 'Black'),
('text_insertborderwidth', 1),
('text_insertofftime', 200),
('text_insertontime', 500),
('text_relief', 'raised'),
('text_relief', 'sunken'),
('Scrollbar_repeatdelay', 200),
('Scrollbar_repeatinterval', 105),
('vscrollmode', 'static'),
('vscrollmode', 'dynamic'),
('hscrollmode', 'static'),
('hscrollmode', 'dynamic'),
('text_selectborderwidth', 2),
('text_state', 'disabled'),
('text_state', 'normal'),
('text_background', 'GhostWhite'),
('vscrollmode', 'bogus', 'ValueError: bad vscrollmode ' +
'option "bogus": should be static, dynamic, or none'),
('hscrollmode', 'bogus', 'ValueError: bad hscrollmode ' +
'option "bogus": should be static, dynamic, or none'),
(c
.cget
, 'vscrollmode', 'bogus'),
(c
.cget
, 'hscrollmode', 'bogus'),
('vscrollmode', 'dynamic'),
('hscrollmode', 'dynamic'),
(c
.insert
, ('end', 'Hello there\n')),
(c
.yview
, ('moveto', 0.02)),
(c
.yview
, ('moveto', 0.04)),
(c
.yview
, ('moveto', 0.06)),
(c
.yview
, ('moveto', 0.08)),
(c
.yview
, ('moveto', 0.10)),
(c
.yview
, ('moveto', 0.12)),
(c
.yview
, ('moveto', 0.14)),
(c
.yview
, ('moveto', 0.16)),
(c
.yview
, ('moveto', 0.18)),
(c
.yview
, ('moveto', 0.20)),
(c
.yview
, ('moveto', 0.22)),
(c
.yview
, ('moveto', 0.24)),
(c
.yview
, ('moveto', 0.26)),
(c
.yview
, ('moveto', 0.28)),
(c
.yview
, ('moveto', 0.98)),
(c
.yview
, ('scroll', -1, 'page')),
(c
.yview
, ('scroll', -50, 'page')),
(c
.yview
, ('scroll', 1, 'page')),
(c
.yview
, ('scroll', 50, 'page')),
'hscrollmode' : 'dynamic',
(c
.pack
, (), {'padx' : 10, 'pady' : 10, 'fill' : 'both', 'expand' : 1}),
(c
.importfile
, 'ScrolledText_test.py'),
('text_relief', 'raised'),
('text_relief', 'sunken'),
testData
= ((Pmw
.ScrolledText
, alltests
),)
if __name__
== '__main__':