|
From: Joe E. <jen...@fl...> - 2006-03-27 21:20:03
|
Vince Darley wrote:
> I notice that the default bindings/style for a ttk::label have the
> text go grey when it is in the background. How can I create a new
> style to apply to a specific label to *not* have this happen just for
> the one label (it's a kind of status-bar with messages the user should
> always be able to read, even if a different window is frontmost).
Here's how that feature works:
+ When a toplevel is "activated" resp. "deactivated"
(OSX terms -- roughly, "becomes frontmost" or "becomes not
frontmost"), Tk sends an <Activate> resp. <Deactivate>
pseudo-event to every subwindow of the toplevel.
+ Tile widgets respond to these events by toggling the
TTK_STATE_BACKGROUND state flag. (This is built into
the widget framework, it's not controlled from scripted
bindings).
+ aquaTheme.tcl defines a root style map:
style map "." \
-foreground [list disabled "#a3a3a3" background "#a3a3a3"]
that applies to all styles in the absense of a more explicit
style map.
The easiest way to turn it off is to override the map:
style map My.TLabel -foreground [list]
or
style map My.TLabel -foreground [list #a3a3a3]
(if you want the label to show 'disabled' feedback).
Another approach (which might be more appropriate for your
application, don't know) is to select one of the MacWindowStyles
or window attributes that doesn't receive <Activate>/<Deactivate>
events.
> Second Q: is it possible to create the smaller, toolbar style
> menubuttons in the Aqua style?
You mean like these?
http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGControls/chapter_18_section_3.html#//apple_ref/doc/uid/TP30000359-BAADHEBI [*]
Possible in 0.7 (I think), but not easy (I'm sure).
I'd planned to include support for many of the Aqua-specific
UI gizmos (bevel buttons, round buttons, small/medium/large variants
of various widget styles, etc. ...) sometime in the 0.8 release
timeframe.
--Joe English
jen...@fl...
[*] That's "Apple Human Interface Guidelines", Part III "The
Aqua Interface", section "Controls", subsection "Selection
Controls", topic "Icon Buttons and Bevel Buttons With Pop-Up
Menus", in case the URL has gone stale.
|