{"id":6136,"date":"2022-12-20T18:57:57","date_gmt":"2022-12-20T21:57:57","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/busy-mann\/"},"modified":"2022-12-20T18:57:57","modified_gmt":"2022-12-20T21:57:57","slug":"busy-mann","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/busy-mann\/","title":{"rendered":"busy (mann)"},"content":{"rendered":"<h1 align=\"center\">busy<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#INTRODUCTION\">INTRODUCTION<\/a><br \/> <a href=\"#OPERATIONS\">OPERATIONS<\/a><br \/> <a href=\"#EVENT HANDLING\">EVENT HANDLING<\/a><br \/> <a href=\"#PORTABILITY\">PORTABILITY<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">busy \u2212 confine pointer events to a window sub-tree<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tk busy<\/b> <i>window<\/i> ?<i>options<\/i>?<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tk busy hold<\/b> <i>window<\/i> ?<i>options<\/i>?<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tk busy configure<\/b> <i>window<\/i> ?<i>option value<\/i>?&#8230;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tk busy forget<\/b> <i>window<\/i> ?<i>window<\/i> ?&#8230;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tk busy current<\/b> ?<i>pattern<\/i>?<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tk busy status<\/b> <i>window<\/i> ______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>tk busy<\/b> command provides a simple means to block pointer events from Tk widgets, while overriding the widget\u2019s cursor with a configurable busy cursor. Note this command does not prevent keyboard events from being sent to the widgets made busy.<\/p>\n<h2>INTRODUCTION <a name=\"INTRODUCTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">There are many times in applications where you want to temporarily restrict what actions the user can take. For example, an application could have a \u201cRun\u201d button that when pressed causes some processing to occur. However, while the application is busy processing, you probably don\u2019t want the user to be able to click the \u201cRun\u201d button again. You may also want restrict the user from other tasks such as clicking a \u201cPrint\u201d button.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>tk busy<\/b> command lets you make Tk widgets busy. This means that user interactions such as button clicks, moving the mouse, typing at the keyboard, etc. are ignored by the widget. You can set a special cursor (like a watch) that overrides the widget\u2019s normal cursor, providing feedback that the application (widget) is temporarily busy.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When a widget is made busy, the widget and all of its descendants will ignore pointer events. It\u2019s easy to make an entire panel of widgets busy. You can simply make the toplevel widget (such as \u201c.\u201d) busy. This is easier and far much more efficient than recursively traversing the widget hierarchy, disabling each widget and re-configuring its cursor.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Often, the <b>tk busy<\/b> command can be used instead of Tk\u2019s <b>grab<\/b> command. Unlike <b>grab<\/b> which restricts all user interactions to one widget, with the <b>tk busy<\/b> command you can have more than one widget active (for example, a \u201cCancel\u201d dialog and a \u201cHelp\u201d button).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>EXAMPLE<\/b> <br \/> You can make several widgets busy by simply making its ancestor widget busy using the <b>hold<\/b> operation.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">frame .top <br \/> button .top.button; canvas .top.canvas <br \/> pack .top.button .top.canvas <br \/> pack .top <br \/> # . . . <b><br \/> tk busy<\/b> hold .top <br \/> update<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">All the widgets within <b>.top<\/b> (including <b>.top<\/b>) are now busy. Using <b>update<\/b> insures that <b>tk busy<\/b> command will take effect before any other user events can occur.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When the application is no longer busy processing, you can allow user interactions again and free any resources it allocated by the <b>forget<\/b> operation.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>tk busy<\/b> forget .top<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The busy window has a configurable cursor. You can change the busy cursor using the <b>configure<\/b> operation.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>tk busy<\/b> configure .top \u2212cursor &#8220;watch&#8221;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Destroying the widget will also clean up any resources allocated by the <b>tk busy<\/b> command.<\/p>\n<h2>OPERATIONS <a name=\"OPERATIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following operations are available for the <b>tk busy<\/b> command: <b><br \/> tk busy<\/b> <i>window<\/i> ?<i>option value<\/i>?&#8230;<\/p>\n<p style=\"margin-left:22%;\">Shortcut for <b>tk busy hold<\/b> command.<\/p>\n<p style=\"margin-left:11%;\"><b>tk busy hold<\/b> <i>window<\/i> ?<i>option value<\/i>?&#8230;<\/p>\n<p style=\"margin-left:22%;\">Makes the specified <i>window<\/i> (and its descendants in the Tk window hierarchy) appear busy. <i>Window<\/i> must be a valid path name of a Tk widget. A transparent window is put in front of the specified window. This transparent window is mapped the next time idle tasks are processed, and the specified window and its descendants will be blocked from user interactions. Normally <b>update<\/b> should be called immediately afterward to insure that the hold operation is in effect before the application starts its processing. The following configuration options are valid: <b><br \/> \u2212cursor<\/b> <i>cursorName<\/i><\/p>\n<p style=\"margin-left:32%;\">Specifies the cursor to be displayed when the widget is made busy. <i>CursorName<\/i> can be in any form accepted by <b>Tk_GetCursor<\/b>. The default cursor is <b>wait<\/b> on Windows and <b>watch<\/b> on other platforms.<\/p>\n<p style=\"margin-left:11%;\"><b>tk busy cget<\/b> <i>window option<\/i><\/p>\n<p style=\"margin-left:22%;\">Queries the <b>tk busy<\/b> command configuration options for <i>window<\/i>. <i>Window<\/i> must be the path name of a widget previously made busy by the <b>hold<\/b> operation. The command returns the present value of the specified <i>option<\/i>. <i>Option<\/i> may have any of the values accepted by the <b>hold<\/b> operation.<\/p>\n<p style=\"margin-left:11%;\"><b>tk busy configure<\/b> <i>window<\/i> ?<i>option value<\/i>?&#8230;<\/p>\n<p style=\"margin-left:22%;\">Queries or modifies the <b>tk busy<\/b> command configuration options for <i>window<\/i>. <i>Window<\/i> must be the path name of a widget previously made busy by the <b>hold<\/b> operation. If no options are specified, a list describing all of the available options for <i>window<\/i> (see <b>Tk_ConfigureInfo<\/b> for information on the format of this list) is returned. If <i>option<\/i> is specified with no <i>value<\/i>, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no <i>option<\/i> is specified). If one or more <i>option\u2212value<\/i> pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns the empty string. <i>Option<\/i> may have any of the values accepted by the <b>hold<\/b> operation.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">Please note that the option database is referenced through <i>window<\/i>. For example, if the widget <b>.frame<\/b> is to be made busy, the busy cursor can be specified for it by either <b>option<\/b> command:<\/p>\n<p style=\"margin-left:32%; margin-top: 1em\">option add *frame.busyCursor gumby <br \/> option add *Frame.BusyCursor gumby<\/p>\n<p style=\"margin-left:11%;\"><b>tk busy forget<\/b> <i>window<\/i> ?<i>window<\/i>?&#8230;<\/p>\n<p style=\"margin-left:22%;\">Releases resources allocated by the <b>tk busy<\/b> command for <i>window<\/i>, including the transparent window. User events will again be received by <i>window<\/i>. Resources are also released when <i>window<\/i> is destroyed. <i>Window<\/i> must be the name of a widget specified in the <b>hold<\/b> operation, otherwise an error is reported.<\/p>\n<p style=\"margin-left:11%;\"><b>tk busy current<\/b> ?<i>pattern<\/i>?<\/p>\n<p style=\"margin-left:22%;\">Returns the pathnames of all widgets that are currently busy. If a <i>pattern<\/i> is given, only the path names of busy widgets matching <i>pattern<\/i> are returned.<\/p>\n<p style=\"margin-left:11%;\"><b>tk busy status<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the status of a widget <i>window<\/i>. If <i>window<\/i> presently can not receive user interactions, <b>1<\/b> is returned, otherwise <b>0<\/b>.<\/p>\n<h2>EVENT HANDLING <a name=\"EVENT HANDLING\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>BINDINGS<\/b> <br \/> The event blocking feature is implemented by creating and mapping a transparent window that completely covers the widget. When the busy window is mapped, it invisibly shields the widget and its hierarchy from all events that may be sent. Like Tk widgets, busy windows have widget names in the Tk window hierarchy. This means that you can use the <b>bind<\/b> command, to handle events in the busy window.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>tk busy<\/b> hold .frame.canvas <br \/> bind .frame.canvas_Busy <Enter> { &#8230; }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Normally the busy window is a sibling of the widget. The name of the busy window is \u201c<i>widget<\/i><b>_Busy<\/b>\u201d where <i>widget<\/i> is the name of the widget to be made busy. In the previous example, the pathname of the busy window is \u201c<b>.frame.canvas_Busy<\/b>\u201d. The exception is when the widget is a toplevel widget (such as \u201c.\u201d) where the busy window can\u2019t be made a sibling. The busy window is then a child of the widget named \u201c<i>widget<\/i><b>._Busy<\/b>\u201d where <i>widget<\/i> is the name of the toplevel widget. In the following example, the pathname of the busy window is \u201c<b>._Busy<\/b>\u201d.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>tk busy<\/b> hold . <br \/> bind ._Busy <Enter> { &#8230; }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ENTER\/LEAVE EVENTS<\/b> <br \/> Mapping and unmapping busy windows generates Enter\/Leave events for all widgets they cover. Please note this if you are tracking Enter\/Leave events in widgets.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>KEYBOARD EVENTS<\/b> <br \/> When a widget is made busy, the widget is prevented from gaining the keyboard focus by a user clicking on it by the busy window. But if the widget already had focus, it still may receive keyboard events. The widget can also still receive focus through keyboard traversal. To prevent this, you must move focus to another window and make sure the focus can not go back to the widgets made busy (e.g. but restricting focus to a cancel button).<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">pack [frame .frame] <br \/> pack [text .frame.text] <b><br \/> tk busy<\/b> hold .frame <br \/> pack [button .cancel -text &#8220;Cancel&#8221; -command exit] <br \/> focus .cancel <br \/> bind .cancel <Tab> {break} <br \/> bind .cancel <Shift-Tab> {break} <br \/> update<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The above example moves the focus from .frame immediately after invoking the <b>hold<\/b> so that no keyboard events will be sent to <b>.frame<\/b> or any of its descendants. It also makes sure it\u2019s not possible to leave button <b>.cancel<\/b> using the keyboard.<\/p>\n<h2>PORTABILITY <a name=\"PORTABILITY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Note that the <b>tk busy<\/b> command does not currently have any effect on OSX when Tk is built using Aqua support.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">grab(n)<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">busy, keyboard events, pointer events, window<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  busy \u2212 confine pointer events to a window sub-tree <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3783,1],"tags":[2791,2635],"class_list":["post-6136","post","type-post","status-publish","format-standard","hentry","category-n-comandos-tcl-tk","category-sin-categoria","tag-busy","tag-mann"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6136"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6136\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}