Tk Source Code

View Ticket
Login
Ticket UUID: f380f2313094ae7f31cc8eed3d6cde0595c53233
Title: style 'Toolbutton' no more effective? macOS
Type: Support Version: ltip
Submitter: Takamoto Created on: 2019-10-12 09:31:17
Subsystem: (unused) Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2019-10-12 15:30:40
Resolution: None Closed By: Takamoto
    Closed on: 2019-10-12 15:30:40
Description:

Hello, I used to have buttons styled with Toolbutton to have nice little icons on modern macOS (pic 1). This has worked with the tip of your current version until a couple of months ago. Now I am moving to a more recent version (latest available) to support Catalina. However, I just noticed that the Toolbutton style is no more available and I get old fashioned buttons (pic 2) that breaks the look of my application. It has been some change I could not track, or am I doing/assuming something wrong? PS: the pics have been generated with the same code, just changing the Tk.framework. Pic 1 Pic 2 Thank you for pointing me to the right direction Takamoto

User Comments: Takamoto added on 2019-10-12 15:30:40:
Solved! I am still not quite sure what was wrong, but with the latest commit (!) my application was pointing to an older version of Tk lost in the system. Thank you for the help! And for the GREAT job. I close the ticket.

kevin_walzer added on 2019-10-12 14:11:22:
I am using the same commit in my build and see the rounded buttons, not the flat ones.

Takamoto added on 2019-10-12 13:51:42:
Sorry for my bad explanation! With 'latest source' I meant the latest commit available <a href="https://core.tcl-lang.org/tk/vinfo?name=cb65fa3bfa5c0664">here</a> (from yesterday I guess), not the tarball in SourceForge.

If we aree that the rounded look are the new one (in my pic MODERN) - as I really hope is the case - I have to confirm that the commit indicated above does not produce such buttons, but the flat ones (in my pic OLD).

kevin_walzer added on 2019-10-12 13:40:45:
What is "the latest source"? The 8.6.9 tarball from Sourceforge? That was released last fall. 

The commit you are referencing for the changed layout is from July - that's the tip of 8.6 development and will be incorporated into 8.6.10, due out soon. 

So, we are in agreement - the rounded look is the new one and the flat look is the older, unsupported version. You are not doing anything wrong. The implementation has changed and will not be rolled back.

Takamoto added on 2019-10-12 13:29:55:
Updated script to match images:

image create photo .imgobj -file "/Users/fc/Desktop/cancel.png"
ttk::button .b1 -image .imgobj  -style "Toolbutton"
ttk::button .b2 -text "Hello" -style "Toolbutton"
ttk::button .b4 -image .imgobj -text " Cancel " -compound "top" -style "Toolbutton"
grid .b1 -row 0 -column 0
grid .b2 -row 0 -column 1
grid .b4 -row 0 -column 3

Takamoto added on 2019-10-12 13:24:52:
A script as simple as this will  demonstrate the inconsistency:

image create photo .imgobj -file "/Users/aaa/Desktop/cancel.png"
ttk::button .b1 -image .imgobj  -style "Toolbutton"
ttk::button .b2 -text "Hello" -style "Toolbutton"
button .b3 -text "Quit"
button .b4 -image .imgobj -text " Cancel " -compound "top"
grid .b1 -row 0 -column 0
grid .b2 -row 0 -column 1
grid .b3 -row 0 -column 2
grid .b4 -row 0 -column 3

If I create the buttons with Frameworks created for example with this source <a href="https://core.tcl-lang.org/tk/info/a82cd76ed5b6eb60">Tk</a> I get what I call the 'modern' look with style Toolbutton (new screenshot 'modern', below) . If I create the buttons with the latest source, I get the "older" look.

In both cases, I compile Tk simply with 'make -C tk8.6.9/macosx' on the same machine with Mojave.

kevin_walzer added on 2019-10-12 13:14:35:
The internal implementation of the Toolbutton style has changed on macOS since Mojave was released - Marc Culler has done a lot of work to update the Aqua theme, make it compatible with Dark Mode, and bring the buttons visually in line with how Apple's apps render them (NSButton vs. the HITheme API that Tk uses). Pic #1 is the new, modern style--the slightly rounded buttons. Pic #2 is the old, flat style of Toolbutton. Your presentation of these images is slightly confusing. If you prefer the rounded style, then great, that is what is now being supported. If you prefer the older, flatter style, I'm sorry - I don't see a case for rolling back Tk to support that style of button as it is more or less visually obsolete on Mac.

fvogel added on 2019-10-12 11:12:02:

Can you provide a test script demonstrating the issue?

You say "the Toolbutton style is no more available": do you get an error when you try to use this style?

How to track this: usage of fossil bisect is the first thing that comes to mind.


Attachments: