|
From: Michael K. <mi...@mu...> - 2006-06-18 18:55:14
|
On Sun, 18 Jun 2006, Jeff Hobbs wrote:
> That looks about right. I don't suppose you would be willing to share the
> magic without me code-diving? I would be willing to examine it and attempt
> to rationalize a more flexible variant for others.
This is the proc that does it (which may or may not be the right way to do
it). It creates a "SearchEntry" layout in all themes:
proc setupThemes {} {
foreach theme [style theme names] {
set pad [style theme settings $theme {
style default TEntry -padding
}]
switch -- [llength $pad] {
0 {
set pad [list 4 0 0 0]
}
1 {
set pad [list [expr {$pad+4}] $pad $pad $pad]
}
2 {
foreach {padx pady} $pad break
set pad [list [expr {$padx+4}] $pady $padx $pady]
}
4 {
foreach {padx1 pady1 padx2 pady2} $pad break
set pad [list [expr {$padx1+4}] $pady1 $padx2 $pady2]
}
}
style theme settings $theme {
style layout SearchEntry {
Entry.field -children {
SearchEntry.icon -side left
Entry.padding -children {
Entry.textarea
}
}
}
style configure SearchEntry -padding $pad
style element create SearchEntry.icon image
$::icons::i16(search) \
-padding {10 0 0 0} -sticky {}
style map SearchEntry -image \
[list disabled $::icons::d16(search)]
}
}
}
--
Michael Kirkham
www.muonics.com
|