# Based on iwidgets2.2.0/tests/combobox.test code.
if Tkinter
.TkVersion
>= 8.4:
expected1
= 'TclError: bad relief "bogus": must be '
expected2
= 'TclError: bad state "bogus": must be ' + \
'disabled, normal, or readonly'
elif Tkinter
.TkVersion
>= 8.3:
expected1
= 'TclError: bad relief "bogus": must be '
expected2
= 'TclError: bad state "bogus": must be disabled or normal'
expected1
= 'TclError: bad relief type "bogus": must be '
expected2
= 'TclError: bad state value "bogus": must be normal or disabled'
'scrolledlist_items': ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'),
'entry_state': 'disabled',
'selectioncommand' : Test
.callback1
,
'scrolledlist_items': ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'),
'label_text' : 'DropDown:',
'listbox_cursor' : 'hand1',
(c
.pack
, (), {'padx' : 10, 'pady' : 10, 'fill' : 'both', 'expand' : 1}),
(Test
.num_options
, (), 11),
('entry_textvariable', Test
.stringvar
),
('label_text', 'ComboBox:'),
('label_image', Test
.flagup
),
('entry_borderwidth', 10),
('entry_borderwidth', 2),
('hull_background', 'steelblue'),
('entry_foreground', 'white'),
('hull_background', 'grey85'),
('entry_foreground', 'Black'),
('entry_textvariable', ''),
('entry_state', 'disabled'),
('entry_state', 'normal'),
('label_font', Test
.font
['variable']),
('entry_font', Test
.font
['large']),
('entry_font', Test
.font
['variable']),
('entry_relief', 'raised'),
('entry_relief', 'groove'),
('entry_relief', 'flat'),
('entry_relief', 'sunken'),
('entry_exportselection', 1),
('entry_exportselection', 0),
('entryfield_invalidcommand', Test
.bell
),
('listbox_cursor', 'hand1'),
('listbox_cursor', 'hand2'),
('entry_selectbackground', '#b2dfee'),
('listbox_selectbackground', 'steelblue'),
('entry_selectborderwidth', 1),
('entry_selectforeground', 'Black'),
('entry_background', 'white'),
('entryfield_validate', 'alphabetic'),
(c
.get
, (), 'this is some text'),
('entryfield_validate', None),
('scrolledlist_hscrollmode', 'dynamic'),
('scrolledlist_hscrollmode', 'dynamic'),
('scrolledlist_vscrollmode', 'dynamic'),
('scrolledlist_vscrollmode', 'dynamic'),
('entry_borderwidth', 'bogus', 'TclError: bad screen distance "bogus"'),
('entry_cursor', 'bogus', 'TclError: bad cursor spec "bogus"'),
('entry_exportselection', 'bogus',
'TclError: expected boolean value but got "bogus"'),
('scrolledlist_hscrollmode', 'bogus',
'ValueError: bad hscrollmode option "bogus": should be static, dynamic, ' +
('listbox_cursor', 'bogus', 'TclError: bad cursor spec "bogus"'),
('entry_relief', 'bogus', expected1
+ Test
.reliefs
),
('entry_selectborderwidth', 'bogus', 'TclError: bad screen distance "bogus"'),
('entry_state', 'bogus', expected2
),
('entryfield_validate', 'bogus',
"ValueError: bad validate value \"bogus\": must be a function or one of " +
"the standard validators ('alphabetic', 'alphanumeric', 'date', " +
"'hexadecimal', 'integer', 'numeric', 'real', 'time') or extra " +
('scrolledlist_vscrollmode', 'bogus',
'ValueError: bad vscrollmode option "bogus": should be static, dynamic, ' +
('entry_width', 'bogus', 'TclError: expected integer but got "bogus"'),
(c
.interior
, (), Tkinter
.Frame
),
(c
.setentry
, 'This is some text', 1),
(c
.get
, (), 'This is some text'),
(c
.get
, (2, 4), ('C', 'D', 'E')),
('listbox_exportselection', 0),
(c
.getcurselection
, (), ('D',)),
(c
.getcurselection
, (), ('H',)),
(c
.insert
, (0, 'Test1', 'Test2', 'Test3', 'Test4')),
(c
.insert
, ('end', 'More Test')),
(c
.selectitem
, 'More Test'),
(c
.curselection
, (), ('0',)),
(c
.getcurselection
, (), ()),
(c
.insert
, ('end', 'Test1', 'Test2', 'Really Long String Test')),
(c
.get
, 2, 'Really Long String Test'),
(c
.insert
, (0, 'Test3', 'Test4', 'Really Long String Test')),
(c
.insert
, (1, 'Test5', 'Test6', 'Really Long String Test')),
(c
.insert
, (5, 'Test7', 'Test8', 'Really Long String Test')),
(c
.get
, 'end', 'Really Long String Test'),
(c
.curselection
, (), ('5',)),
'arrowbutton_relief': 'groove',
'selectioncommand' : Test
.callback
,
'hull_background' : 'red',
'scrolledlist_items' : (123, 456, 789, 101112),
'label_text' : 'Numeric Simple:',
'entryfield_validate' : 'numeric',
(c
.pack
, (), {'padx' : 10, 'pady' : 10, 'fill' : 'both', 'expand' : 1}),
testData
= ((c
, alltests
),)
if __name__
== '__main__':