@@ -188,6 +188,15 @@ def test_configure_compound(self):
188
188
widget = self .create ()
189
189
self .checkEnumParam (widget , 'compound' , * values , allow_empty = True )
190
190
191
+ @requires_tk (8 , 7 )
192
+ def test_configure_justify (self ):
193
+ widget = self .create ()
194
+ values = ('left' , 'right' , 'center' )
195
+ if tk_version >= (8 , 7 ):
196
+ values += ('' ,)
197
+ self .checkEnumParam (widget , 'justify' , * values ,
198
+ fullname = 'justification' )
199
+
191
200
def test_configure_width (self ):
192
201
widget = self .create ()
193
202
self .checkParams (widget , 'width' , 402 , - 402 , 0 )
@@ -207,11 +216,6 @@ class LabelTest(AbstractLabelTest, unittest.TestCase):
207
216
def create (self , ** kwargs ):
208
217
return ttk .Label (self .root , ** kwargs )
209
218
210
- def test_configure_font (self ):
211
- widget = self .create ()
212
- self .checkParam (widget , 'font' ,
213
- '-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*' )
214
-
215
219
def test_configure_justify (self ):
216
220
widget = self .create ()
217
221
values = ('left' , 'right' , 'center' )
@@ -220,11 +224,17 @@ def test_configure_justify(self):
220
224
self .checkEnumParam (widget , 'justify' , * values ,
221
225
fullname = 'justification' )
222
226
227
+ def test_configure_font (self ):
228
+ widget = self .create ()
229
+ self .checkParam (widget , 'font' ,
230
+ '-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*' )
231
+
232
+
223
233
@add_standard_options (StandardTtkOptionsTests )
224
234
class ButtonTest (AbstractLabelTest , unittest .TestCase ):
225
235
OPTIONS = (
226
236
'class' , 'command' , 'compound' , 'cursor' , 'default' ,
227
- 'image' , 'padding' , 'state' , 'style' ,
237
+ 'image' , 'justify' , ' padding' , 'state' , 'style' ,
228
238
'takefocus' , 'text' , 'textvariable' ,
229
239
'underline' , 'width' ,
230
240
)
@@ -249,7 +259,7 @@ def test_invoke(self):
249
259
class CheckbuttonTest (AbstractLabelTest , unittest .TestCase ):
250
260
OPTIONS = (
251
261
'class' , 'command' , 'compound' , 'cursor' ,
252
- 'image' ,
262
+ 'image' , 'justify' ,
253
263
'offvalue' , 'onvalue' ,
254
264
'padding' , 'state' , 'style' ,
255
265
'takefocus' , 'text' , 'textvariable' ,
@@ -338,6 +348,7 @@ class EntryTest(AbstractWidgetTest, unittest.TestCase):
338
348
'background' , 'class' , 'cursor' ,
339
349
'exportselection' , 'font' , 'foreground' ,
340
350
'invalidcommand' , 'justify' ,
351
+ 'placeholder' , 'placeholderforeground' ,
341
352
'show' , 'state' , 'style' , 'takefocus' , 'textvariable' ,
342
353
'validate' , 'validatecommand' , 'width' , 'xscrollcommand' ,
343
354
)
@@ -460,7 +471,8 @@ class ComboboxTest(EntryTest, unittest.TestCase):
460
471
OPTIONS = (
461
472
'background' , 'class' , 'cursor' , 'exportselection' ,
462
473
'font' , 'foreground' , 'height' , 'invalidcommand' ,
463
- 'justify' , 'postcommand' , 'show' , 'state' , 'style' ,
474
+ 'justify' , 'placeholder' , 'placeholderforeground' , 'postcommand' ,
475
+ 'show' , 'state' , 'style' ,
464
476
'takefocus' , 'textvariable' ,
465
477
'validate' , 'validatecommand' , 'values' ,
466
478
'width' , 'xscrollcommand' ,
@@ -720,7 +732,7 @@ def test_sashpos(self):
720
732
class RadiobuttonTest (AbstractLabelTest , unittest .TestCase ):
721
733
OPTIONS = (
722
734
'class' , 'command' , 'compound' , 'cursor' ,
723
- 'image' ,
735
+ 'image' , 'justify' ,
724
736
'padding' , 'state' , 'style' ,
725
737
'takefocus' , 'text' , 'textvariable' ,
726
738
'underline' , 'value' , 'variable' , 'width' ,
@@ -774,7 +786,7 @@ def cb_test():
774
786
class MenubuttonTest (AbstractLabelTest , unittest .TestCase ):
775
787
OPTIONS = (
776
788
'class' , 'compound' , 'cursor' , 'direction' ,
777
- 'image' , 'menu' , 'padding' , 'state' , 'style' ,
789
+ 'image' , 'justify' , ' menu' , 'padding' , 'state' , 'style' ,
778
790
'takefocus' , 'text' , 'textvariable' ,
779
791
'underline' , 'width' ,
780
792
)
@@ -906,8 +918,9 @@ def test_set(self):
906
918
@add_standard_options (StandardTtkOptionsTests )
907
919
class ProgressbarTest (AbstractWidgetTest , unittest .TestCase ):
908
920
OPTIONS = (
909
- 'class' , 'cursor' , 'orient' , 'length' ,
910
- 'mode' , 'maximum' , 'phase' ,
921
+ 'anchor' , 'class' , 'cursor' , 'font' , 'foreground' , 'justify' ,
922
+ 'orient' , 'length' ,
923
+ 'mode' , 'maximum' , 'phase' , 'text' , 'wraplength' ,
911
924
'style' , 'takefocus' , 'value' , 'variable' ,
912
925
)
913
926
_conv_pixels = False
@@ -916,6 +929,27 @@ class ProgressbarTest(AbstractWidgetTest, unittest.TestCase):
916
929
def create (self , ** kwargs ):
917
930
return ttk .Progressbar (self .root , ** kwargs )
918
931
932
+ @requires_tk (8 , 7 )
933
+ def test_configure_anchor (self ):
934
+ widget = self .create ()
935
+ self .checkEnumParam (widget , 'anchor' ,
936
+ 'n' , 'ne' , 'e' , 'se' , 's' , 'sw' , 'w' , 'nw' , 'center' , '' )
937
+
938
+ @requires_tk (8 , 7 )
939
+ def test_configure_font (self ):
940
+ widget = self .create ()
941
+ self .checkParam (widget , 'font' ,
942
+ '-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*' )
943
+
944
+ test_configure_foreground = requires_tk (8 , 7 )(StandardOptionsTests .test_configure_foreground )
945
+
946
+ @requires_tk (8 , 7 )
947
+ def test_configure_justify (self ):
948
+ widget = self .create ()
949
+ values = ('left' , 'right' , 'center' , '' )
950
+ self .checkEnumParam (widget , 'justify' , * values ,
951
+ fullname = 'justification' )
952
+
919
953
def test_configure_length (self ):
920
954
widget = self .create ()
921
955
self .checkPixelsParam (widget , 'length' , 100.1 , 56.7 , '2i' )
@@ -932,11 +966,15 @@ def test_configure_phase(self):
932
966
# XXX
933
967
pass
934
968
969
+ test_configure_text = requires_tk (8 , 7 )(StandardOptionsTests .test_configure_text )
970
+
935
971
def test_configure_value (self ):
936
972
widget = self .create ()
937
973
self .checkFloatParam (widget , 'value' , 150.2 , 77.7 , 0 , - 10 ,
938
974
conv = False )
939
975
976
+ test_configure_wraplength = requires_tk (8 , 7 )(StandardOptionsTests .test_configure_wraplength )
977
+
940
978
941
979
@unittest .skipIf (sys .platform == 'darwin' ,
942
980
'ttk.Scrollbar is special on MacOSX' )
@@ -1173,7 +1211,9 @@ class SpinboxTest(EntryTest, unittest.TestCase):
1173
1211
OPTIONS = (
1174
1212
'background' , 'class' , 'command' , 'cursor' , 'exportselection' ,
1175
1213
'font' , 'foreground' , 'format' , 'from' , 'increment' ,
1176
- 'invalidcommand' , 'justify' , 'show' , 'state' , 'style' ,
1214
+ 'invalidcommand' , 'justify' ,
1215
+ 'placeholder' , 'placeholderforeground' ,
1216
+ 'show' , 'state' , 'style' ,
1177
1217
'takefocus' , 'textvariable' , 'to' , 'validate' , 'validatecommand' ,
1178
1218
'values' , 'width' , 'wrap' , 'xscrollcommand' ,
1179
1219
)
@@ -1347,8 +1387,9 @@ def test_configure_values(self):
1347
1387
class TreeviewTest (AbstractWidgetTest , unittest .TestCase ):
1348
1388
OPTIONS = (
1349
1389
'class' , 'columns' , 'cursor' , 'displaycolumns' ,
1350
- 'height' , 'padding' , 'selectmode' , 'show' ,
1351
- 'style' , 'takefocus' , 'xscrollcommand' , 'yscrollcommand' ,
1390
+ 'height' , 'padding' , 'selectmode' , 'selecttype' , 'show' , 'striped' ,
1391
+ 'style' , 'takefocus' , 'titlecolumns' , 'titleitems' ,
1392
+ 'xscrollcommand' , 'yscrollcommand' ,
1352
1393
)
1353
1394
1354
1395
def setUp (self ):
@@ -1393,6 +1434,11 @@ def test_configure_selectmode(self):
1393
1434
self .checkEnumParam (widget , 'selectmode' ,
1394
1435
'none' , 'browse' , 'extended' )
1395
1436
1437
+ @requires_tk (8 , 7 )
1438
+ def test_configure_selecttype (self ):
1439
+ widget = self .create ()
1440
+ self .checkEnumParam (widget , 'selecttype' , 'item' , 'cell' )
1441
+
1396
1442
def test_configure_show (self ):
1397
1443
widget = self .create ()
1398
1444
self .checkParam (widget , 'show' , 'tree headings' ,
@@ -1402,6 +1448,23 @@ def test_configure_show(self):
1402
1448
self .checkParam (widget , 'show' , 'tree' , expected = ('tree' ,))
1403
1449
self .checkParam (widget , 'show' , 'headings' , expected = ('headings' ,))
1404
1450
1451
+ @requires_tk (8 , 7 )
1452
+ def test_configure_striped (self ):
1453
+ widget = self .create ()
1454
+ self .checkBooleanParam (widget , 'striped' )
1455
+
1456
+ @requires_tk (8 , 7 )
1457
+ def test_configure_titlecolumns (self ):
1458
+ widget = self .create ()
1459
+ self .checkIntegerParam (widget , 'titlecolumns' , 0 , 1 , 5 )
1460
+ self .checkInvalidParam (widget , 'titlecolumns' , - 2 )
1461
+
1462
+ @requires_tk (8 , 7 )
1463
+ def test_configure_titleitems (self ):
1464
+ widget = self .create ()
1465
+ self .checkIntegerParam (widget , 'titleitems' , 0 , 1 , 5 )
1466
+ self .checkInvalidParam (widget , 'titleitems' , - 2 )
1467
+
1405
1468
def test_bbox (self ):
1406
1469
self .tv .pack ()
1407
1470
self .assertEqual (self .tv .bbox ('' ), '' )
0 commit comments