# HG changeset patch # User Rik # Date 1552519918 25200 # Node ID d7856bf83781fb46b9856eacb48a6f498623eb3e # Parent 73b141d5a888009a82460af33244b1a09191877a Improve new figure creation time by 50%. * __add_default_menu__.m: Create toolbar with "visible", "off" and then populate it. Only at the end of the function is the toolbar made visible. diff -r 73b141d5a888 -r d7856bf83781 scripts/plot/util/private/__add_default_menu__.m --- a/scripts/plot/util/private/__add_default_menu__.m Wed Mar 13 21:57:11 2019 +0000 +++ b/scripts/plot/util/private/__add_default_menu__.m Wed Mar 13 16:31:58 2019 -0700 @@ -38,8 +38,8 @@ ## Create if (isempty (hmenu)) ## File menu - hui = uimenu (hf, "label", "&File", "handlevisibility", "off", ... - "tag", "__default_menu__File"); + hui = uimenu (hf, "label", "&File", "tag", "__default_menu__File", ... + "handlevisibility", "off"); uimenu (hui, "label", "&Open", "callback", @open_cb, ... "accelerator", "o"); uimenu (hui, "label", "&Save", "callback", {@save_cb, "save"}, ... @@ -95,7 +95,7 @@ ## Default toolbar init_mouse_tools (hf); htb = uitoolbar (hf, "tag", "__default_toolbar__", ... - "handlevisibility", "off"); + "handlevisibility", "off", "visible", "off"); ht(1) = uitoggletool (htb, "tooltipstring", "Pan", ... "tag", "__default_button_pan__", ... @@ -137,7 +137,6 @@ "offcallback", {@mouse_tools_cb, ht, "text"}); endif - if (! exist ("ht", "var")) ht = get (htb, "children")(end:-1:1); istoggletool = strcmp (get (ht, "type"), "uitoggletool");