NAME
TkGrab, TkUngrab - manipulate grab state in an application
SYNOPSIS
##iinncclluuddee <
int TTkkGGrraabb(interp, tkwin, grabGlobal) void TTkkUUnnggrraabb(tkwin) AARRGGUUMMEENNTTSS TclInterp *interp (in) Interpreter to use for error reporting TkWindow tkwin (in) Window on whose behalf the pointer is to be grabbed or released int grabGlobal (in) Boolean indicating whether> the grab is global or appli-
cation localDESCRIPTION
These functions are used to set or release a global or applicationlocal grab. When a grab is set on a particular window in a Tk applica-
tion, mouse and keyboard events can only be received by that window and its descendants. Mouse and keyboard events for windows outside the tree rooted at tkwin will be redirected to tkwin. If the grab is global, then all mouse and keyboard events for windows outside the tree rooted at tkwin (even those intended for windows in other applications) will be redirected to tkwin. If the grab is application local, onlymouse and keyboard events intended for a windows within the same appli-
cation (but outside the tree rooted at tkwin) will be redirected. TTkkGGrraabb sets a grab on a particular window. Tkwin specifies the window on whose behalf the pointer is to be grabbed. GrabGlobal indicateswhether the grab should be global or application local; if it is non-
zero, it means the grab should be global. Normally, TTkkGGrraabb returnsTCLOK; if an error occurs and the grab cannot be set, TCLERROR is
returned and an error message is left if interp's result. Once this call completes successfully, no window outside the tree rooted at tkwinwill receive pointer- or keyboard-related events until the next call to
TkUngrab. If a previous grab was in effect within the application, then it is replaced with a new one. TTccllUUnnggrraabb releases a grab on the mouse pointer and keyboard, if there is one set on the window given by tkwin. Once a grab is released, pointer and keyboard events will start being delivered to other windows again. KKEEYYWWOORRDDSS grab, window Tk TkGrab(3)