{"id":6220,"date":"2022-12-20T18:58:02","date_gmt":"2022-12-20T21:58:02","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/bindtags-mann\/"},"modified":"2022-12-20T18:58:02","modified_gmt":"2022-12-20T21:58:02","slug":"bindtags-mann","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/bindtags-mann\/","title":{"rendered":"bindtags (mann)"},"content":{"rendered":"<h1 align=\"center\">bindtags<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLE\">EXAMPLE<\/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\">bindtags \u2212 Determine which bindings apply to a window, and order of evaluation<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>bindtags<\/b> <i>window<\/i> ?<i>tagList<\/i>? ______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">When a binding is created with the <b>bind<\/b> command, it is associated either with a particular window such as <b>.a.b.c<\/b>, a class name such as <b>Button<\/b>, the keyword <b>all<\/b>, or any other string. All of these forms are called <i>binding tags<\/i>. Each window contains a list of binding tags that determine how events are processed for the window. When an event occurs in a window, it is applied to each of the window\u2019s tags in order: for each tag, the most specific binding that matches the given tag and event is executed. See the <b>bind<\/b> command for more information on the matching process.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">By default, each window has four binding tags consisting of the name of the window, the window\u2019s class name, the name of the window\u2019s nearest toplevel ancestor, and <b>all<\/b>, in that order. Toplevel windows have only three tags by default, since the toplevel name is the same as that of the window. The <b>bindtags<\/b> command allows the binding tags for a window to be read and modified.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <b>bindtags<\/b> is invoked with only one argument, then the current set of binding tags for <i>window<\/i> is returned as a list. If the <i>tagList<\/i> argument is specified to <b>bindtags<\/b>, then it must be a proper list; the tags for <i>window<\/i> are changed to the elements of the list. The elements of <i>tagList<\/i> may be arbitrary strings; however, any tag starting with a dot is treated as the name of a window; if no window by that name exists at the time an event is processed, then the tag is ignored for that event. The order of the elements in <i>tagList<\/i> determines the order in which binding scripts are executed in response to events. For example, the command<\/p>\n<p style=\"margin-left:22%;\"><b>bindtags .b {all . Button .b}<\/b><\/p>\n<p style=\"margin-left:11%;\">reverses the order in which binding scripts will be evaluated for a button named <b>.b<\/b> so that <b>all<\/b> bindings are invoked first, following by bindings for <b>.b<\/b>\u2019s toplevel (\u201c.\u201d), followed by class bindings, followed by bindings for <b>.b<\/b>. If <i>tagList<\/i> is an empty list then the binding tags for <i>window<\/i> are returned to the default state described above.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>bindtags<\/b> command may be used to introduce arbitrary additional binding tags for a window, or to remove standard tags. For example, the command<\/p>\n<p style=\"margin-left:22%;\"><b>bindtags .b {.b TrickyButton . all}<\/b><\/p>\n<p style=\"margin-left:11%;\">replaces the <b>Button<\/b> tag for <b>.b<\/b> with <b>TrickyButton<\/b>. This means that the default widget bindings for buttons, which are associated with the <b>Button<\/b> tag, will no longer apply to <b>.b<\/b>, but any bindings associated with <b>TrickyButton<\/b> (perhaps some new button behavior) will apply.<\/p>\n<h2>EXAMPLE <a name=\"EXAMPLE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">If you have a set of nested <b>frame<\/b> widgets and you want events sent to a <b>button<\/b> widget to also be delivered to all the widgets up to the current <b>toplevel<\/b> (in contrast to Tk\u2019s default behavior, where events are not delivered to those intermediate windows) to make it easier to have accelerators that are only active for part of a window, you could use a helper procedure like this to help set things up:<\/p>\n<p style=\"margin-left:22%;\">proc setupBindtagsForTreeDelivery {widget} { <br \/> set tags [list $widget [winfo class $widget]] <br \/> set w $widget <br \/> set t [winfo toplevel $w] <br \/> while {$w ne $t} { <br \/> set w [winfo parent $w] <br \/> lappend tags $w <br \/> } <br \/> lappend tags all <b><br \/> bindtags<\/b> $widget $tags <br \/> }<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">bind(n)<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">binding, event, tag<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  bindtags \u2212 Determine which bindings apply to a window, and order of evaluation <\/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":[2845,2635],"class_list":["post-6220","post","type-post","status-publish","format-standard","hentry","category-n-comandos-tcl-tk","category-sin-categoria","tag-bindtags","tag-mann"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6220","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=6220"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6220\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}