Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modal toplevel window

Status
Not open for further replies.

lordexcelsi

Programmer
Jun 18, 2003
1
CO
Please Help Me it's very urgent...

I have created a window with toplevel but I want that the window be modal.
How can I do that???

Thanks.
 
See the grab command of Tk.

For the grab page of the Tk manual:
NAME
grab - Confine pointer and keyboard events to a window sub-tree

SYNOPSIS
grab ?-global? window
grab option ?arg arg ...?

DESCRIPTION
This command implements simple pointer and keyboard grabs for Tk. Tk's grabs are different than the grabs described in the Xlib documentation. When a grab is set for a particular window, Tk restricts all pointer events to the grab window and its descendants in Tk's window hierarchy. Whenever the pointer is within the grab window's subtree, the pointer will behave exactly the same as if there had been no grab at all and all events will be reported in the normal fashion. When the pointer is outside window's tree, button presses and releases and mouse motion events are reported to window, and window entry and window exit events are ignored. The grab subtree ``owns'' the pointer: windows outside the grab subtree will be visible on the screen but they will be insensitive until the grab is released. The tree of windows underneath the grab window can include top-level windows, in which case all of those top-level windows and their descendants will continue to receive mouse events during the grab.
Two forms of grabs are possible: local and global. A local grab affects only the grabbing application: events will be reported to other applications as if the grab had never occurred. Grabs are local by default. A global grab locks out all applications on the screen, so that only the given subtree of the grabbing application will be sensitive to pointer events (mouse button presses, mouse button releases, pointer motions, window entries, and window exits). During global grabs the window manager will not receive pointer events either.


More info at:
and

HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top