From: Adrian R. <adr...@gm...> - 2010-02-16 13:22:49
|
I've hit a similar problem in the past, although in my case it showed both on Windows and OS X. I ended up needing to do this to ensure the window came to front: wm deiconify .fooDialog after idle { wm deiconify .fooDialog raise .fooDialog focus -force .fooDialog } (The last line can also focus a window within the toplevel.) It seemed like this was overkill, but it works robustly so I haven't messed with it. Reason why needed, my guess was that it relates to the fact that the dialogs in question come from button-presses on another window.. Perhaps an extra mouse event gets sent to the parent window after the press, causing it to take focus. On Feb 15, 2010, at 6:26 PM, Peter Caffin wrote: > Hi guys. > > I'm running into an odd problem on Mac (Leopard) using Tcl/Tk 8.5. > > I create a prefs window and iconify it, then deiconify and grab when the > user calls for the prefs dialog. Unfortunately, sometimes the dialog > appears behind the main window despite having focus and grab applied. If > I click the title bar of the obscuring window, the prefs window pops up > in front as expected. > > I can't confirm if the same happens on Snowy or Tiger. I can definitely > confirm it doesn't happen on Linux/X11 or Windows. > > The code I'm using to raise the window is: wm deiconify .pref ; grab .pref > > I've also tried, without much change: wm deiconify .pref ; grab -global > .pref > > The odd thing is, it doesn't happen all the time, just some of the time. > > I'm guessing I'm probably not the only one who's encountered this one. > > Any suggestions? > > > Pete. > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > Tcl-mac mailing list > tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac |