|
From: Joe E. <jen...@fl...> - 2007-10-31 00:34:44
|
Schelte Bron wrote:
> I'm trying to create a scrollbar with a grip in the middle of
> the thumb element. It looks exactly like I want when I do:
> [... see below ...]
> The problem however is that the grip part of the thumb does not
> respond to thumb events, like dragging it with the mouse. Is
> there any way of applying the thumb bindings to the grip as
> well (something similar to bindtags)?
That's what the (undocumented) "-unit" flag is for.
(It was added to handle Windows XP scrollbar grips,
which work the same way.)
A node with this flag set and all its descendants
are treated as a single element by [$w identify] and
the internal state-tracking logic. So:
> ttk::style layout Vertical.TScrollbar {
> Vertical.Scrollbar.uparrow -side top -sticky {}
> Vertical.Scrollbar.downarrow -side bottom -sticky {}
> Vertical.Scrollbar.trough -sticky ns -children {
> Vertical.Scrollbar.thumb -expand 1 -sticky nswe -unit 1 -children {
^^^^^^^ add this
> Vertical.Scrollbar.grip -sticky {}
> }
> }
> }
should do the trick.
> I think such a feature would (or could
> be used to) solve the problem reported in bug #1574874 too.
The current semantics of "-unit" aren't quite right to
fix that problem, but I think with a small change they
might be.
--JE
|