in reply to Re: Tk: WaitBox widget not grabbing correctly
in thread Tk: WaitBox widget not grabbing correctly

Hi,

I think I am still unable to get main window out of focus. If I use the above code - it opens a dialog box which has initial focus, but I can easily move mouse to MainWindow and do all operations like - Minimize, Maximize, Move and even CLOSE, which I dont want

You might try grabGlobal and see the effect, I want the same affect but locking only the MainWindow and not whole WindowManager.

  • Comment on Re^2: Tk: WaitBox widget not grabbing correctly

Replies are listed 'Best First'.
Re^3: Tk: WaitBox widget not grabbing correctly
by zentara (Cardinal) on Jun 29, 2005 at 11:13 UTC
    The operations you are talking about, are "Window Manager" controls, which are not controlled by Tk. However Tk has a way to disable/enable them. Use overrideredirect(). In the code I posted above do this:
    my $mw = MainWindow->new(); $mw->geometry("+100+100"); $mw->title("Main Window"); $mw->overrideredirect(1); $mw->bind("<Return>", \&do_dialog);
    then if you desire to return full WindowManager controls back to the mainwindow, put:
    $mw->overrideredirect(0);
    somewhere in your code where it's convenient, like only if you get a "yes" response.

    You could also set it up to have your popup dialog use overrideredirect too.


    I'm not really a human, but I play one on earth. flash japh