|
From: Mats B. <ma...@pr...> - 2007-11-24 08:15:10
|
Jeff Hobbs wrote:
> Joe English wrote:
>> There are no plans for a ttk::text widget. The text widget
>> is massively complicated and would not benefit much from the
>> Tile framework: the only themable part is the border, and
>> it's mostly an "owner-draw" widget (which the framework isn't
>> very good at handling). Reimplementing it doesn't seem
>> worth the effort.
>
> What is the latest status of border-draw handling specialization support
> in tile? This would alleviate issues that users see on the text and
> listbox widgets related to specialized borders (like on the mac), when
> the widget has focus. There was some hackery on the wiki, but it had
> some "issues" iirc.
>
I use the following which seems to work well...
# UI::Text --
#
# Faking Aqua text widget. Note that the container frame is returned.
# From comp.lang.tcl Thank You!
proc ::UI::Text {w args} {
if {[tk windowingsystem] eq "aqua"} {
set wcont [string range $w 0 [string last "." $w]]_cont
ttk::frame $wcont -style TEntry
eval {text $w -borderwidth 0 -highlightthickness 0} $args
bind $w <FocusIn> [list $wcont state focus]
bind $w <FocusOut> [list $wcont state {!focus}]
pack $w -in $wcont -padx 5 -pady 5 -fill both -expand 1
return $wcont
} else {
eval $w $args
return $w
}
}
|