From: zdia <z....@gm...> - 2010-03-29 14:33:19
|
The issue is the following: The application is doing some init work and meantime the main window is withdrawn, then a toplevel dialog appears and when it is finished the main window is raised with the application menubar. The code is as follows: wm withdraw . initGui # the toplevel dialog is entering set oldGrab [grab current .] update idletasks raise $top focus $entrywidget catch {grab $top} ;# this command is freezing the Mac menubar # the toplevel job if {$oldGrab != ""} { catch {grab $oldGrab} } else { # catch {focus .} ;# not working either catch {grab release $top} } wm withdraw $top update wm deiconify . raise . update On Windows and Linux the main window with the menubar is appearing but not on the version I have compiled: http://github.com/downloads/das/tcltk/tk8.5.8-decarbon.tar.gz Only the first application menu is activated so it is possible to quit the application. If I insert additionally "grab .", "focus ." or "focus -force ." then even the first application menu is deactivated and the application cannot be closed by menu. Well, the workaround will be to comment the grab command out but is there another (Mac specific) way to work with a toplevel window? Zbigniew -- View this message in context: http://old.nabble.com/how-to-handle-the-grab-mechanism-for-toplevel-dialogs-in-TkCocoa-8.5.8--tp28070171p28070171.html Sent from the tcl-mac mailing list archive at Nabble.com. |