fabricior...@gmail.com wrote:
> Anyway, it is really a pity and a serious limitation for my
> purposes that it does not work for Ttk widgets. I still have to
> find an "universal" method which would work for both.
>
> Maybe is there a way to, kind of, add the -highlightbackground
> property to Ttk widgets by using ttk::style or the options
> database? Or packing/griding a colored frame in the same position
> of the widget and push it down with [lower]? I experimented a
> little bit, but couldn't really get the desired result...
>
There's a third geometry manager that probably works best for this
job:
proc highlight {w {bg red} {bd 2}} {
set h [frame $w-highlight -background $bg]
place $h -in $w -x -$bd -y -$bd \
-relwidth 1 -width [expr {2 * $bd}] \
-relheight 1 -height [expr {2 * $bd}]
# raise $w
lower $h $w
return $h
}
Uncommenting the raise command may give you better visual results
when widgets are close together, but it also changes the order for
keyboard traversal. Pick whichever option is most important for your
application.
Schelte.