Re: [MACTCL] Making a Tk GUI more "Mac-like"
by Joe English other posts by this author
Jul 26 2007 11:41AM messages near this date
Re: [MACTCL] Making a Tk GUI more "Mac-like"
|
Re: [MACTCL] Making a Tk GUI more "Mac-like"
Kevin Walzer wrote:
> Joe English wrote:
> > Note that [ttk::button] widgets provide an easier way to
> > achieve this effect:
> > [...]
> The issue here is that, under Aqua, Tk buttons (whether standard or
> Tile's toolbutton style) darken completely when they are pressed. Modern
> toolbutton behavior on the Mac (if accessed via the HIToolbar API)
> doesn't work this way: the image and/or text darkens, but the rest of
> the button retains transparency. Tk buttons with images are mapped to
> the bevel button widget under Aqua, which is an older widget style not
> much used anymore.
Tile's built-in aqua Toolbutton style also uses bevel buttons.
But that's easy to fix, see below...
(The aqua theme, unfortunately, still looks circa OSX 10.2.
I haven't done a very good job keeping up with Apple, sorry :-(.
> Using your suggestion works to alter the image
> depending on the button's state, but the entire button still gets dark
> when pressed--which is what I'm trying to avoid.
>
> I'm pretty sure changing this behavior at the C level would be a lot of
> work, and I don't have the first clue how to do it.
In this particular case you don't need to do anything in C --
you can replace the default Toolbutton layout with:
style theme settings aqua {
style layout Toolbar.TButton {
Toolbar.TButton.padding -children {
Toolbar.TButton.label
}
}
style configure Toolbar.TButton -padding {whatever's appropriate}
# Possibly: use [style map ... ] to change foreground settings.
}
(Using "Toolbar.TButton" style instead of "Toolbutton",
so as not to interfere with Toolbutton-style check- and
radiobuttons.)
Some of the other OSX-specific stuff -- round buttons,
small and tiny sizes for various controls, etc., --
do require new C code for support [*], but 10.4-style
toolbar buttons are simple enough -- there's almost nothing
to them, just a label -- that you can build one in Tcl.
[*] Which I will get around to implementing someday ...
--Joe English
jenglish@[...].com
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now > > http://get.splunk.com/
_______________________________________________
Tcl-mac mailing list
tcl-mac@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-mac
Thread:
Kevin Walzer
Mats Bengtsson
Kevin Walzer
Mats Bengtsson
Kevin Walzer
Joe English
Kevin Walzer
Joe English
Kevin Walzer
Adrian Robert
Philip Aker
Kevin Walzer
Philip Aker
Jim DeVona
|