1
namespace eval ::chameleon::label {
2
proc label_customParseConfArgs {w parsed_options args } {
3
array set options $args
4
array set ttk_options $parsed_options
6
if { [info exists options(-padx)] && [string is digit -strict $options(-padx)] } {
7
set padx $options(-padx)
12
if { [info exists options(-pady)] && [string is digit -strict $options(-pady)] } {
13
set pady $options(-pady)
18
if {$padx == 0 && $pady == 0 && [info exists options(-bd)] } {
19
set ttk_options(-padding) $options(-bd)
21
if {$padx == 0 && $pady != 0 } {
22
set ttk_options(-padding) [list 2 $pady]
23
} elseif {$padx != 0 && $pady == 0 } {
24
set ttk_options(-padding) [list $padx 2]
25
} elseif {$padx != 0 && $pady != 0 } {
26
set ttk_options(-padding) [list $padx $pady]
30
if { [info exists options(-width)] } {
31
if {$options(-width) == 0} {
32
set ttk_options(-width) [list]
34
set ttk_options(-width) $options(-width)
38
if { [info exists options(-image)] } {
39
array unset ttk_options -width
42
return [array get ttk_options]
45
proc init_labelCustomOptions { } {
46
variable label_widgetOptions
48
array set label_widgetOptions {
49
-activebackground -ignore
50
-activeforeground -ignore
52
-background -background
57
-borderwidth -styleOption
61
-disabledforeground -ignore
64
-foreground -foreground
66
-highlightbackground -ignore
67
-highlightcolor -ignore
68
-highlightthickness -ignore
77
-textvariable -textvariable
80
-wraplength -wraplength
84
proc label_customCget { w option } {
85
set padding [$w cget -padding]
87
if { [llength $padding] > 0 } {
88
foreach {padx pady} $padding {break}
91
if { $option eq "-padx" && [info exists padx] } {
94
if { $option eq "-pady" && [info exists pady] } {
98
if {$option eq "-width"} {
99
set width [$w cget -width]
101
if {![string is digit -strict $width]} {