Tk Source Code

View Ticket
Login
Ticket UUID: e3ad5e0fcaef0842cf5adb2bb9402514357c8564
Title: macOS XQuartz : issue with menu
Type: Bug Version: 8.7a4
Submitter: nab Created on: 2021-05-19 13:47:06
Subsystem: 12. Unix Menus Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2021-05-20 13:22:44
Resolution: Fixed Closed By: nab
    Closed on: 2021-05-20 13:22:44
Description:
Hi,
I think there's an issue with menu when using Tk compiled as a dylib (linked against XQuartz)
I do create menus with -tearoff 0 option

if I use the library that comes with trunk, I need to modify 138 of tearoff.tcl like that:
    if {$last eq "none" || $last eq ""} {

otherwise when I click on a button that post a menu, the menu is appearing then disappearing unless I hold the click.

best regards,
nicolas
User Comments: nab added on 2021-05-20 13:22:44:
thank you for the explanation !
but on XQuartz, I take care of using trunk and not branches related to macOS improvement.

thanks,
++

jan.nijtmans added on 2021-05-20 13:16:20:

So, you were using glyph_indexing_2, which includes TIP #577, which uses "" in stead of "none" for consistency with other widgets. That explains a lot.

No, using "" in stead of "none" is not an error, it's on purpose. TIP #577 proposed to use "" in stead of "none" in menu's (although "none" still works too)


nab added on 2021-05-20 12:19:26:
thank you Jan,
there's a "lot" of place in menu.tcl where there's code like :
$menu activate {}

it should be $menu activate none isn't it?

can you please also merge the change in mac_styles_87 branch and glyph_indexing_2.

++

jan.nijtmans added on 2021-05-20 11:49:51:

I'm not sure how $last got to be equal to "", what I know is that Tk is not consistent in values meaning "none": Sometimes "-1" or "" is used for the same purpose (See also TIP #577). Therefore those kind of checks should handle "none", "-1" and "" all the same, that's the safe way to go.

Should be fixed now in 8.6 and 8.7 branch.