Lines Matching refs:widget
48 def checkParam(self, widget, name, value, *, expected=_sentinel, argument
50 widget[name] = value
62 self.assertEqual2(widget[name], expected, eq=eq)
63 self.assertEqual2(widget.cget(name), expected, eq=eq)
64 t = widget.configure(name)
68 def checkInvalidParam(self, widget, name, value, errmsg=None, *, argument
70 orig = widget[name]
74 widget[name] = value
78 self.assertEqual(widget[name], orig)
80 widget[name] = orig
82 widget.configure({name: value})
86 self.assertEqual(widget[name], orig)
88 widget[name] = orig
90 def checkParams(self, widget, name, *values, **kwargs): argument
92 self.checkParam(widget, name, value, **kwargs)
94 def checkIntegerParam(self, widget, name, *values, **kwargs): argument
95 self.checkParams(widget, name, *values, **kwargs)
96 self.checkInvalidParam(widget, name, '',
98 self.checkInvalidParam(widget, name, '10p',
100 self.checkInvalidParam(widget, name, 3.2,
103 def checkFloatParam(self, widget, name, *values, conv=float, **kwargs): argument
105 self.checkParam(widget, name, value, conv=conv, **kwargs)
106 self.checkInvalidParam(widget, name, '',
108 self.checkInvalidParam(widget, name, 'spam',
111 def checkBooleanParam(self, widget, name): argument
113 self.checkParam(widget, name, value, expected=0)
115 self.checkParam(widget, name, value, expected=1)
116 self.checkInvalidParam(widget, name, '',
118 self.checkInvalidParam(widget, name, 'spam',
121 def checkColorParam(self, widget, name, *, allow_empty=None, **kwargs): argument
122 self.checkParams(widget, name,
126 self.checkInvalidParam(widget, name, 'spam',
129 def checkCursorParam(self, widget, name, **kwargs): argument
130 self.checkParams(widget, name, 'arrow', 'watch', 'cross', '',**kwargs)
132 self.checkParam(widget, name, 'none')
133 self.checkInvalidParam(widget, name, 'spam',
136 def checkCommandParam(self, widget, name): argument
139 widget[name] = command
140 self.assertTrue(widget[name])
141 self.checkParams(widget, name, '')
143 def checkEnumParam(self, widget, name, *values, errmsg=None, **kwargs): argument
144 self.checkParams(widget, name, *values, **kwargs)
151 self.checkInvalidParam(widget, name, '',
154 self.checkInvalidParam(widget, name, 'spam', errmsg=errmsg)
156 def checkPixelsParam(self, widget, name, *values, argument
167 self.checkParam(widget, name, value, expected=expected,
169 self.checkInvalidParam(widget, name, '6x',
171 self.checkInvalidParam(widget, name, 'spam',
174 def checkReliefParam(self, widget, name): argument
175 self.checkParams(widget, name,
181 self.checkInvalidParam(widget, name, 'spam',
184 def checkImageParam(self, widget, name): argument
186 self.checkParam(widget, name, image, conv=str)
187 self.checkInvalidParam(widget, name, 'spam',
189 widget[name] = ''
191 def checkVariableParam(self, widget, name, var): argument
192 self.checkParam(widget, name, var, conv=str)
206 widget = self.create()
207 keys = widget.keys()
208 self.assertEqual(sorted(keys), sorted(widget.configure()))
210 widget[k]
246 widget = self.create()
247 self.checkColorParam(widget, 'activebackground')
250 widget = self.create()
251 self.checkPixelsParam(widget, 'activeborderwidth',
255 widget = self.create()
256 self.checkColorParam(widget, 'activeforeground')
259 widget = self.create()
260 self.checkEnumParam(widget, 'anchor',
264 widget = self.create()
265 self.checkColorParam(widget, 'background')
267 self.checkColorParam(widget, 'bg')
270 widget = self.create()
271 self.checkParam(widget, 'bitmap', 'questhead')
272 self.checkParam(widget, 'bitmap', 'gray50')
274 self.checkParam(widget, 'bitmap', '@' + filename)
279 self.checkInvalidParam(widget, 'bitmap', 'spam',
283 widget = self.create()
284 self.checkPixelsParam(widget, 'borderwidth',
287 self.checkPixelsParam(widget, 'bd', 0, 1.3, 2.6, 6, -2, '10p')
290 widget = self.create()
291 self.checkEnumParam(widget, 'compound',
295 widget = self.create()
296 self.checkCursorParam(widget, 'cursor')
299 widget = self.create()
300 self.checkColorParam(widget, 'disabledforeground')
303 widget = self.create()
304 self.checkBooleanParam(widget, 'exportselection')
307 widget = self.create()
308 self.checkParam(widget, 'font',
310 self.checkInvalidParam(widget, 'font', '',
314 widget = self.create()
315 self.checkColorParam(widget, 'foreground')
317 self.checkColorParam(widget, 'fg')
320 widget = self.create()
321 self.checkColorParam(widget, 'highlightbackground')
324 widget = self.create()
325 self.checkColorParam(widget, 'highlightcolor')
328 widget = self.create()
329 self.checkPixelsParam(widget, 'highlightthickness',
331 self.checkParam(widget, 'highlightthickness', -2, expected=0,
335 widget = self.create()
336 self.checkImageParam(widget, 'image')
339 widget = self.create()
340 self.checkColorParam(widget, 'insertbackground')
343 widget = self.create()
344 self.checkPixelsParam(widget, 'insertborderwidth',
348 widget = self.create()
349 self.checkIntegerParam(widget, 'insertofftime', 100)
352 widget = self.create()
353 self.checkIntegerParam(widget, 'insertontime', 100)
356 widget = self.create()
357 self.checkPixelsParam(widget, 'insertwidth', 1.3, 2.6, -2, '10p')
360 widget = self.create()
361 self.checkBooleanParam(widget, 'jump')
364 widget = self.create()
365 self.checkEnumParam(widget, 'justify', 'left', 'right', 'center',
368 self.checkInvalidParam(widget, 'justify', '',
373 widget = self.create()
374 self.assertEqual(str(widget['orient']), self.default_orient)
375 self.checkEnumParam(widget, 'orient', 'horizontal', 'vertical')
378 widget = self.create()
379 self.checkPixelsParam(widget, 'padx', 3, 4.4, 5.6, -2, '12m',
383 widget = self.create()
384 self.checkPixelsParam(widget, 'pady', 3, 4.4, 5.6, -2, '12m',
388 widget = self.create()
389 self.checkReliefParam(widget, 'relief')
392 widget = self.create()
393 self.checkIntegerParam(widget, 'repeatdelay', -500, 500)
396 widget = self.create()
397 self.checkIntegerParam(widget, 'repeatinterval', -500, 500)
400 widget = self.create()
401 self.checkColorParam(widget, 'selectbackground')
404 widget = self.create()
405 self.checkPixelsParam(widget, 'selectborderwidth', 1.3, 2.6, -2, '10p')
408 widget = self.create()
409 self.checkColorParam(widget, 'selectforeground')
412 widget = self.create()
413 self.checkBooleanParam(widget, 'setgrid')
416 widget = self.create()
417 self.checkEnumParam(widget, 'state', 'active', 'disabled', 'normal')
420 widget = self.create()
421 self.checkParams(widget, 'takefocus', '0', '1', '')
424 widget = self.create()
425 self.checkParams(widget, 'text', '', 'any string')
428 widget = self.create()
430 self.checkVariableParam(widget, 'textvariable', var)
433 widget = self.create()
434 self.checkColorParam(widget, 'troughcolor')
437 widget = self.create()
438 self.checkIntegerParam(widget, 'underline', 0, 1, 10)
441 widget = self.create()
442 self.checkPixelsParam(widget, 'wraplength', 100)
445 widget = self.create()
446 self.checkCommandParam(widget, 'xscrollcommand')
449 widget = self.create()
450 self.checkCommandParam(widget, 'yscrollcommand')
455 widget = self.create()
456 self.checkCommandParam(widget, 'command')
459 widget = self.create()
460 self.checkBooleanParam(widget, 'indicatoron')
463 widget = self.create()
464 self.checkReliefParam(widget, 'offrelief')
467 widget = self.create()
468 self.checkReliefParam(widget, 'overrelief')
471 widget = self.create()
472 self.checkColorParam(widget, 'selectcolor')
475 widget = self.create()
476 self.checkImageParam(widget, 'selectimage')
480 widget = self.create()
481 self.checkImageParam(widget, 'tristateimage')
485 widget = self.create()
486 self.checkParam(widget, 'tristatevalue', 'unknowable')
489 widget = self.create()
491 self.checkVariableParam(widget, 'variable', var)
496 widget = self.create()
497 self.checkIntegerParam(widget, 'height', 100, -100, 0)
500 widget = self.create()
501 self.checkIntegerParam(widget, 'width', 402, -402, 0)
506 widget = self.create()
507 self.checkPixelsParam(widget, 'height', 100, 101.2, 102.6, -100, 0, '3c')
510 widget = self.create()
511 self.checkPixelsParam(widget, 'width', 402, 403.4, 404.6, -402, 0, '5i')
529 widget = self.create()
530 widget[option]