ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcl-mac
tcl-mac
Re: [MACTCL] Making a Tk GUI more "Mac-like"
by Kevin Walzer other posts by this author
Jul 26 2007 10:26AM messages near this date
Re: [MACTCL] Making a Tk GUI more "Mac-like" | Re: [MACTCL] Making a Tk GUI more "Mac-like"
Joe English wrote:
>  Kevin Walzer wrote:
>  
> >> It should be easy to get the Aqua look, just use a darkened image in a new
> >> layout for ttk::button. However, the mouse-over button/labels are Safari
> >> look-alikes. I use the toolbar x-platform so I did a compromise.
> >> See my sources: coccinella/contrib/ttoolbar.tcl and
> >> coccinella/contrib/tileutils.tcl for sources.
> >> Note also the mouse-over darkened collapse arrows in the toolbars.
> >> (tileutils.tcl : style layout Arrow.TCheckbutton)
> > I use a darkened image with a label and bind that to a <Button-1> action.
>  
>  Note that [ttk::button] widgets provide an easier way to
>  achieve this effect: do something like
>  
>  	$b configure -image [list $normalIcon  > 		disabled $greyIcon  pressed $darkIcon  active 
$lightIcon]
>  
>  and the built-in bindings and style engine will take care 
>  of the rest automatically.   (This is a lot less error-prone
>  than trying to manage the -image by hand.)
>  
>  All Tile widget -image options work this way -- "-image"
>  takes a list, the first element is the default image, the
>  remaining elements specify state-specific overrides.
>  
>  
>  --Joe English
>  

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. 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. So I'm working 
around it at the script level by emulating the HIToolbar functionality 
via labels, image swapping, and bindings.

--Kevin

-------------------------------------------------------------------------
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved