From: SourceForge.net <no...@so...> - 2010-09-14 05:27:20
|
Bugs item #3044863, was opened at 2010-08-14 12:57 Message generated for change (Comment added) made by stefanhaller You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=3044863&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 01. Bindings Group: None Status: Open Resolution: None Priority: 9 Private: No Submitted By: Lloyd Wood (lloydwood) Assigned to: Daniel A. Steffen (das) Summary: Tk Mac crashes when accelerator key spawns window Initial Comment: I have a cross-platform application that I have just added menu accelerators (keypress shortcuts) to.Works fine on Tcl/Tk in Linux and in Windows (Cygwin Insight). Freezes on Mac OS X 10.6 Snow Leopard when an accelerator key is pressed to spawn a window. I have a demonstration of this freeze (can't upload the tarball code, there's a 256k limit): http://personal.ee.surrey.ac.uk/Personal/L.Wood/software/SaVi/src/unreleased/savi-dev-kevin.tar.gz tar xvf savi-dev-kevin.tar cd savi-dev-kevin make ARCH=macosx ./savi & Click on the letterbox-shaped table-of-numbers window, then press either command-G to spawn the Global coverage window, command-F to spawn the fisheye window, or command-M to get the _empty space_ dialog - all windows will draw but missing a Mac titlebar and controls, and then the application freezes. If you relaunch savi and only point and click on the menu options, everything is fine. If you relaunch savi and force use of popup menus rather than the Mac menubar with the savi -redrawn-menus flag (more on the reason for that flag below), accelerators work fine. It's accelerators plus the Mac menubar that is the problem. A previous example you may have read about on the tcl-mac mailing list: The Tk Mac menubar never worked at all in 10.5 when Tk applications were launched from the terminal (I implemented a workaround for that in savi with -redrawn-menus and popup menus within window frames that avoided using the broken menubar - oddly, I see accelerators work fine from the Mac popup menus I implemented to work around that previous problem. Again, it's related to the Mac menubar). The release of 10.6 and the upgrade to Tcl/Tk in Xcode eventually fixed that problem (along with other Mac-specific problems like too-wide listboxes causing hangs), but that took eighteen months to happen, and has now exposed this crash. This appears at first glance to be a similar _maybe the Tk shipped with 10.7 will fix it_-level Mac menuing bug; I do not see what I can do about it, as the installed base on Snow Leopard has Xcode with Tcl/Tk 8.5.7 and that's it. Tk on the Mac should imo be as robust as Tk on other platforms, and should not require workarounds to prevent crashes. (I posted about this to the tcl-mac list, but, despite being a subscriber, my posts hit a filter rule and are queued for a moderator to look at. Hence the background detail here.) ---------------------------------------------------------------------- Comment By: Stefan Haller (stefanhaller) Date: 2010-09-14 07:27 Message: Here's a small example that illustrates the problem. Choosing "Show Dialog" from the File menu works fine; hitting F1 hangs. (When using wish8.4 instead of wish, it works fine.) This bug also affects git gui and gitk. For example, hitting Command-P in git gui (for "Push") hangs. ---------------------------------------------------------------------------------- #!/usr/bin/wish menu .mbar . config -menu .mbar .mbar add cascade -label "File" -menu [menu .mbar.file] set m .mbar.file .mbar.file add command -label "Show Dialog" -command show_dialog \ -accelerator F1 bind . <F1> show_dialog proc show_dialog {} { set w .error toplevel $w message $w.m -text "Message text" -justify center -aspect 400 pack $w.m -side top -fill x -padx 20 -pady 20 button $w.ok -default active -text "OK" -command "destroy $w" pack $w.ok -side bottom -fill x tkwait window $w } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=3044863&group_id=12997 |