|
|
|
|
|
The result is as follows: |
|
|
|
 |
|
|
|
|
['-activebackground', activeBackground, Foreground, "#ececec', '#ececec'],
['-activeforeground',activeForeground,Background,Black,Black],['-activeimage',
activeImage,ActiveImage,undef,undef],['-anchor','anchor',Anchor, 'center',
'center'],['-background','background',Background,'#d9d9d9','#d9d9d9'],['-bd',
borderWidth], ['-bg','background'],['-bitmap','bitmap',Bitmap,undef,undef],
['-borderwidth',borderWidth,BorderWidth,2,2],['-command','command',Command,
undef,bless([CODE(0x8189888)],Tk::Callback)],['-cursor','cursor',Cursor,
undef,undef],['-disabledforeground',disabledForeground,DisabledForeground,
'#a3a3a3','#a3a3a3'],['-fg','foreground'],['-font','font',Font,'-Adobe
-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-*','-Adobe-Helvetica-Bold-R-Normal
--*-120-*-*-*-*-*-*'],['-foreground','foreground',Foreground,Black,Black],
['-height','height',Height,0,0],['-highlightbackground',highlightBackground,
HighlightBackground, '#d9d9d9','#d9d9d9'],['-highlightcolor',highlightColor,
HighlightColor,Black,Black],['-highlightthickness',highlightThickness,
HighlightThickness,2,2],['-image','image',Image,undef,undef],['-justify',
'justify',Justify,'center','center'],['-padx',padx,pad,3,9],['-pady',pady,
Pad,1m,3],['-relief','relief','Relief,"raised','raised'],['-state','state',
State,'normal','normal'],['-takefocus',takeFocus,TakeFocus,undef,undef],
['-text','text',Text,undef,Do_Something],['-textvariable',textVariable,
Variable,undef,undef],['-underline','underline',Underline,-1,-1],['-width',
'width',Width,0,0],['-wraplength',wrapLength,WrapLength,0,0] |
|
|
|
|
|
|
|
|
Although this list may look nasty and ugly, it distinguishes between the different lists of lists for you by adding the [and] characters and the commas that separates them. Usually, you would only look at this list for debugging purposes. The default values for each widget are listed at the end of this appendix. |
|
|
|
|
|
|
|
|
Instead of using configure to retrieve values, you can use the cget method: |
|
|
|
 |
|
|
|
|
$widget->cget(-option) |
|
|
|
|
|
|
|
|
It only returns the current value (or address if the option stores a reference) of the option rather than the entire list that configure returns. Think of cget as standing for "configuration get.". Here is an example of how to use cget: |
|
|
|
 |
|
|
|
|
print $b->cget(-highlightthickness), "\n";
## Prints this:
2
# return reference :
print $option_menu->cget(-textvariable), "\n";
# return actual value:
Print ${$option_menu->cget(-textvariable)}, "\n";
# or...
$ref = $option_menu->cget(-textvariable);
print $$ref, "\n"; |
|
|
|
|