{"thread":{"id":"7406","subject":"[PATCH 4/5] Fix drop-down menus in the git-gui dialogs.","startedAt":"2007-03-26T07:39:02Z","lastAt":"2007-03-26T07:39:02Z","messageCount":1,"participants":["Eygene Ryabinkin"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"38003","messageId":"20070326073902.GH44578@codelabs.ru","threadId":"7406","inReplyTo":null,"subject":"[PATCH 4/5] Fix drop-down menus in the git-gui dialogs.","fromName":"Eygene Ryabinkin","fromEmail":"rea-git@codelabs.ru","sentAt":"2007-03-26T07:39:02Z","receivedAt":"2007-03-26T07:39:02Z","isPatch":true,"sender":{"key":"rea-git@codelabs.ru","avatar":null},"body":"If the drop-down menu (for example \"Local Branch\" from the dialog\nactivated by the \"Branch/Create...\" menu item) is chosen with the\nleft mouse button, then the pointer is moved off the drop-down menu\nwhile the mouse button is still pressed and then the 'Escape' key\nis pressed, the main menu will be broken. Next time when you will\ntry to select any main menu item, the Tcl/Tk interpreter will spawn\nan internal error.\n\nError was fixed by \"grab\"bing the drop-down menu windows on their\nactivation. Now all drop-down menus are disappearing once the mouse\nbutton is depressed, no matter what is the current position of the\nmouse pointer.\n\nSigned-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>\n---\n git-gui/git-gui.sh |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 13c440d..f10cfa7 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -2115,6 +2115,7 @@ proc do_create_branch {} {\n \t\t-font font_ui\n \tset lbranchm [eval tk_optionMenu $w.from.head_m create_branch_head \\\n \t\t$all_heads]\n+\tbind $lbranchm <Visibility> \"grab $lbranchm\"\n \t$lbranchm configure -font font_ui\n \t$w.from.head_m configure -font font_ui\n \tgrid $w.from.head_r $w.from.head_m -sticky w\n@@ -2129,6 +2130,7 @@ proc do_create_branch {} {\n \t\tset tbranchm [eval tk_optionMenu $w.from.tracking_m \\\n \t\t\tcreate_branch_trackinghead \\\n \t\t\t$all_trackings]\n+\t\tbind $tbranchm <Visibility> \"grab $tbranchm\"\n \t\t$tbranchm configure -font font_ui\n \t\t$w.from.tracking_m configure -font font_ui\n \t\tgrid $w.from.tracking_r $w.from.tracking_m -sticky w\n@@ -2144,6 +2146,7 @@ proc do_create_branch {} {\n \t\tset tagsm [eval tk_optionMenu $w.from.tag_m \\\n \t\t\tcreate_branch_tag \\\n \t\t\t$all_tags]\n+\t\tbind $tagsm <Visibility> \"grab $tagsm\"\n \t\t$tagsm configure -font font_ui\n \t\t$w.from.tag_m configure -font font_ui\n \t\tgrid $w.from.tag_r $w.from.tag_m -sticky w\n@@ -2342,6 +2345,7 @@ proc do_delete_branch {} {\n \tset mergedlocalm [eval tk_optionMenu $w.validate.head_m \\\n \t\tdelete_branch_head \\\n \t\t$all_heads]\n+\tbind $mergedlocalm <Visibility> \"grab $mergedlocalm\"\n \t$mergedlocalm configure -font font_ui\n \t$w.validate.head_m configure -font font_ui\n \tgrid $w.validate.head_r $w.validate.head_m -sticky w\n@@ -2356,6 +2360,7 @@ proc do_delete_branch {} {\n \t\tset mergedtrackm [eval tk_optionMenu $w.validate.tracking_m \\\n \t\t\tdelete_branch_trackinghead \\\n \t\t\t$all_trackings]\n+\t\tbind $mergedtrackm <Visibility> \"grab $mergedtrackm\"\n \t\t$mergedtrackm configure -font font_ui\n \t\t$w.validate.tracking_m configure -font font_ui\n \t\tgrid $w.validate.tracking_r $w.validate.tracking_m -sticky w\n@@ -2728,6 +2733,7 @@ proc do_push_anywhere {} {\n \t\t\t-font font_ui\n \t\tset remmenu [eval tk_optionMenu $w.dest.remote_m push_remote \\\n \t\t\t$all_remotes]\n+\t\tbind $remmenu <Visibility> \"grab $remmenu\"\n \t\t$remmenu configure -font font_ui\n \t\t$w.dest.remote_m configure -font font_ui\n \t\tgrid $w.dest.remote_r $w.dest.remote_m -sticky w\n@@ -4687,6 +4693,7 @@ proc do_options {} {\n \t\tset fontmenu [eval tk_optionMenu $w.global.$name.family \\\n \t\t\tglobal_config_new(gui.$font^^family) \\\n \t\t\t$all_fonts]\n+\t\tbind $fontmenu <Visibility> \"grab $fontmenu\"\n \t\t$w.global.$name.family configure -font font_ui\n \t\t$fontmenu configure -font font_ui\n \t\tspinbox $w.global.$name.size \\\n-- \n1.5.0.3-dirty\n"}]}