Lines Matching refs:widget
54 def checkParam(self, widget, name, value, expected=_sentinel, argument
56 widget[name] = value
68 self.assertEqual2(widget[name], expected, eq=eq)
69 self.assertEqual2(widget.cget(name), expected, eq=eq)
71 if not isinstance(widget, Scale):
72 t = widget.configure(name)
76 def checkInvalidParam(self, widget, name, value, errmsg=None, argument
78 orig = widget[name]
82 widget[name] = value
86 self.assertEqual(widget[name], orig)
88 widget[name] = orig
90 widget.configure({name: value})
94 self.assertEqual(widget[name], orig)
96 widget[name] = orig
98 def checkParams(self, widget, name, *values, **kwargs): argument
100 self.checkParam(widget, name, value, **kwargs)
102 def checkIntegerParam(self, widget, name, *values, **kwargs): argument
103 self.checkParams(widget, name, *values, **kwargs)
104 self.checkInvalidParam(widget, name, '',
106 self.checkInvalidParam(widget, name, '10p',
108 self.checkInvalidParam(widget, name, 3.2,
111 def checkFloatParam(self, widget, name, *values, **kwargs): argument
117 self.checkParam(widget, name, value, conv=conv, **kwargs)
118 self.checkInvalidParam(widget, name, '',
120 self.checkInvalidParam(widget, name, 'spam',
123 def checkBooleanParam(self, widget, name): argument
125 self.checkParam(widget, name, value, expected=0)
127 self.checkParam(widget, name, value, expected=1)
128 self.checkInvalidParam(widget, name, '',
130 self.checkInvalidParam(widget, name, 'spam',
133 def checkColorParam(self, widget, name, allow_empty=None, **kwargs): argument
134 self.checkParams(widget, name,
138 self.checkInvalidParam(widget, name, 'spam',
141 def checkCursorParam(self, widget, name, **kwargs): argument
142 self.checkParams(widget, name, 'arrow', 'watch', 'cross', '',**kwargs)
144 self.checkParam(widget, name, 'none')
145 self.checkInvalidParam(widget, name, 'spam',
148 def checkCommandParam(self, widget, name): argument
151 widget[name] = command
152 self.assertTrue(widget[name])
153 self.checkParams(widget, name, '')
155 def checkEnumParam(self, widget, name, *values, **kwargs): argument
160 self.checkParams(widget, name, *values, **kwargs)
167 self.checkInvalidParam(widget, name, '',
170 self.checkInvalidParam(widget, name, 'spam', errmsg=errmsg)
172 def checkPixelsParam(self, widget, name, *values, **kwargs): argument
190 self.checkParam(widget, name, value, expected=expected,
192 self.checkInvalidParam(widget, name, '6x',
194 self.checkInvalidParam(widget, name, 'spam',
197 def checkReliefParam(self, widget, name): argument
198 self.checkParams(widget, name,
204 self.checkInvalidParam(widget, name, 'spam',
207 def checkImageParam(self, widget, name): argument
209 self.checkParam(widget, name, image, conv=str)
210 self.checkInvalidParam(widget, name, 'spam',
212 widget[name] = ''
214 def checkVariableParam(self, widget, name, var): argument
215 self.checkParam(widget, name, var, conv=str)
228 widget = self.create()
229 keys = widget.keys()
231 if not isinstance(widget, Scale):
232 self.assertEqual(sorted(keys), sorted(widget.configure()))
234 widget[k]
270 widget = self.create()
271 self.checkColorParam(widget, 'activebackground')
274 widget = self.create()
275 self.checkPixelsParam(widget, 'activeborderwidth',
279 widget = self.create()
280 self.checkColorParam(widget, 'activeforeground')
283 widget = self.create()
284 self.checkEnumParam(widget, 'anchor',
288 widget = self.create()
289 self.checkColorParam(widget, 'background')
291 self.checkColorParam(widget, 'bg')
294 widget = self.create()
295 self.checkParam(widget, 'bitmap', 'questhead')
296 self.checkParam(widget, 'bitmap', 'gray50')
298 self.checkParam(widget, 'bitmap', '@' + filename)
303 self.checkInvalidParam(widget, 'bitmap', 'spam',
307 widget = self.create()
308 self.checkPixelsParam(widget, 'borderwidth',
311 self.checkPixelsParam(widget, 'bd', 0, 1.3, 2.6, 6, -2, '10p')
314 widget = self.create()
315 self.checkEnumParam(widget, 'compound',
319 widget = self.create()
320 self.checkCursorParam(widget, 'cursor')
323 widget = self.create()
324 self.checkColorParam(widget, 'disabledforeground')
327 widget = self.create()
328 self.checkBooleanParam(widget, 'exportselection')
331 widget = self.create()
332 self.checkParam(widget, 'font',
334 self.checkInvalidParam(widget, 'font', '',
338 widget = self.create()
339 self.checkColorParam(widget, 'foreground')
341 self.checkColorParam(widget, 'fg')
344 widget = self.create()
345 self.checkColorParam(widget, 'highlightbackground')
348 widget = self.create()
349 self.checkColorParam(widget, 'highlightcolor')
352 widget = self.create()
353 self.checkPixelsParam(widget, 'highlightthickness',
355 self.checkParam(widget, 'highlightthickness', -2, expected=0,
361 widget = self.create()
362 self.checkImageParam(widget, 'image')
365 widget = self.create()
366 self.checkColorParam(widget, 'insertbackground')
369 widget = self.create()
370 self.checkPixelsParam(widget, 'insertborderwidth',
374 widget = self.create()
375 self.checkIntegerParam(widget, 'insertofftime', 100)
378 widget = self.create()
379 self.checkIntegerParam(widget, 'insertontime', 100)
382 widget = self.create()
383 self.checkPixelsParam(widget, 'insertwidth', 1.3, 2.6, -2, '10p')
386 widget = self.create()
387 self.checkBooleanParam(widget, 'jump')
390 widget = self.create()
391 self.checkEnumParam(widget, 'justify', 'left', 'right', 'center',
394 self.checkInvalidParam(widget, 'justify', '',
399 widget = self.create()
400 self.assertEqual(str(widget['orient']), self.default_orient)
401 self.checkEnumParam(widget, 'orient', 'horizontal', 'vertical')
404 widget = self.create()
405 self.checkPixelsParam(widget, 'padx', 3, 4.4, 5.6, -2, '12m',
409 widget = self.create()
410 self.checkPixelsParam(widget, 'pady', 3, 4.4, 5.6, -2, '12m',
414 widget = self.create()
415 self.checkReliefParam(widget, 'relief')
418 widget = self.create()
419 self.checkIntegerParam(widget, 'repeatdelay', -500, 500)
422 widget = self.create()
423 self.checkIntegerParam(widget, 'repeatinterval', -500, 500)
426 widget = self.create()
427 self.checkColorParam(widget, 'selectbackground')
430 widget = self.create()
431 self.checkPixelsParam(widget, 'selectborderwidth', 1.3, 2.6, -2, '10p')
434 widget = self.create()
435 self.checkColorParam(widget, 'selectforeground')
438 widget = self.create()
439 self.checkBooleanParam(widget, 'setgrid')
442 widget = self.create()
443 self.checkEnumParam(widget, 'state', 'active', 'disabled', 'normal')
446 widget = self.create()
447 self.checkParams(widget, 'takefocus', '0', '1', '')
450 widget = self.create()
451 self.checkParams(widget, 'text', '', 'any string')
454 widget = self.create()
456 self.checkVariableParam(widget, 'textvariable', var)
459 widget = self.create()
460 self.checkColorParam(widget, 'troughcolor')
463 widget = self.create()
464 self.checkIntegerParam(widget, 'underline', 0, 1, 10)
467 widget = self.create()
468 self.checkPixelsParam(widget, 'wraplength', 100)
471 widget = self.create()
472 self.checkCommandParam(widget, 'xscrollcommand')
475 widget = self.create()
476 self.checkCommandParam(widget, 'yscrollcommand')
481 widget = self.create()
482 self.checkCommandParam(widget, 'command')
485 widget = self.create()
486 self.checkBooleanParam(widget, 'indicatoron')
489 widget = self.create()
490 self.checkReliefParam(widget, 'offrelief')
493 widget = self.create()
494 self.checkReliefParam(widget, 'overrelief')
497 widget = self.create()
498 self.checkColorParam(widget, 'selectcolor')
501 widget = self.create()
502 self.checkImageParam(widget, 'selectimage')
506 widget = self.create()
507 self.checkImageParam(widget, 'tristateimage')
511 widget = self.create()
512 self.checkParam(widget, 'tristatevalue', 'unknowable')
515 widget = self.create()
517 self.checkVariableParam(widget, 'variable', var)
522 widget = self.create()
523 self.checkIntegerParam(widget, 'height', 100, -100, 0)
526 widget = self.create()
527 self.checkIntegerParam(widget, 'width', 402, -402, 0)
532 widget = self.create()
533 self.checkPixelsParam(widget, 'height', 100, 101.2, 102.6, -100, 0, '3c')
536 widget = self.create()
537 self.checkPixelsParam(widget, 'width', 402, 403.4, 404.6, -402, 0, '5i')
554 widget = self.create()
555 widget[option]