Guest Report post Posted November 26, 2014 Add the following codes (change to your needs) into "hmcustom.tcl" : set mypath "C:/Users/MYNAME/myscripts"; set top_menu [hm_framework getpulldowns] catch {$top_menu delete [.hmMainMenuBar index "MyMenu"]} catch {destroy $top_menu.custom} menu $top_menu.custom -tearoff 0 $top_menu insert 20 cascade -label "MyMenu" -menu $top_menu.custom set cat1 $top_menu.custom $cat1 add cascade -label "Category 1" -underline 0 -menu [menu $cat1.mnu1 -title "Cat-1"] $cat1.mnu1 add command -label "Script 1" -command "source {$mypath/script1.tcl}" -underline 0 $cat1.mnu1 add command -label "Script 2" -command "source {$mypath/script2.tcl}" -underline 0 $top_menu.custom add separator set cat2 $top_menu.custom $cat2 add cascade -label "Category 2" -underline 0 -menu [menu $cat2.mnu2 -title "Cat-2"] $cat2.mnu2 add command -label "Script 21" -command "source {$mypath/script21.tcl}" -underline 0 $cat2.mnu2 add command -label "Script 22" -command "source {$mypath/script22.tcl}" -underline 0Start HM and you get your customized menus, see screenshot. Iron_Man59 likes this Quote Share this post Link to post Share on other sites
lawrence yan 0 Report post Posted January 26, 2015 Hello, First of all, great job, this topic is really useful! I just have one question. How do I create a second level of cascade? I want that after "Category 1" a new cascade appears with "Category 1_1" and "Category 1_2" and then I'll place my macros on those menus. Regards, Lawrence Quote Share this post Link to post Share on other sites
tinh 739 Report post Posted January 28, 2015 Hello, First of all, great job, this topic is really useful! I just have one question. How do I create a second level of cascade? I want that after "Category 1" a new cascade appears with "Category 1_1" and "Category 1_2" and then I'll place my macros on those menus. Regards, Lawrence Hi you can make sub-menu by pathname add cascade http://www.tcl.tk/man/tcl8.5/TkCmd/menu.htm#M26 ngoc.tam likes this Quote Share this post Link to post Share on other sites
lawrence yan 0 Report post Posted January 28, 2015 Thanks for the reply! Quote Share this post Link to post Share on other sites
ngoc.tam 0 Report post Posted March 24, 2016 I can not file location's hmcustom.tcl , Is this the same hmsettings.tcl and same location. When i add the codes, i can not see the new Menu also, But when i run the new codes. Its ok. But i can not use the sub-menu. and This sub-menu can use normally if i call direct Quote Share this post Link to post Share on other sites
tinh 739 Report post Posted March 25, 2016 it's in <altair_home>\hm\bin\winxx ngoc.tam likes this Quote Share this post Link to post Share on other sites
ngoc.tam 0 Report post Posted March 25, 2016 Yes, Thanks Mr Tinh Quote Share this post Link to post Share on other sites
Jack LC 1 Report post Posted August 30, 2016 Hello, thanks a lot for the topic, it's very useful! It works great the first time I open HM. However, I have a problem when I change the user profile (Preferences->User Profiles). If I change the profile, my menu disappears. I understood that, changing the profile, all the menus are reloaded and the hmcustom.tcl is loaded only the first time, but I didn't found a workaround to reload my menu. Thanks for any reply. Regards Quote Share this post Link to post Share on other sites
tinh 739 Report post Posted August 31, 2016 21 hours ago, Jack LC said: Hello, thanks a lot for the topic, it's very useful! It works great the first time I open HM. However, I have a problem when I change the user profile (Preferences->User Profiles). If I change the profile, my menu disappears. I understood that, changing the profile, all the menus are reloaded and the hmcustom.tcl is loaded only the first time, but I didn't found a workaround to reload my menu. Thanks for any reply. Regards Hi, to reload hmcustom.tcl after userprofile changed, add below code to hmcustom.tcl: set ::hmcustomtclpath [info script] proc ::reloadhmcustomtcl args { source $::hmcustomtclpath } if {[lsearch -exact [hm_framework getregisteredprocs after_userprofile] ::reloadhmcustomtcl]!=-1} { hm_framework registerproc ::reloadhmcustomtcl after_userprofile } Pandurang and Jack LC like this Quote Share this post Link to post Share on other sites
Jack LC 1 Report post Posted August 31, 2016 Hi tinh, thanks, I appreciate a lot your valuable and fast reply. Your code works fine, I had just to replace !=1 with ==1 in the if condition. Thanks again! Regards tinh likes this Quote Share this post Link to post Share on other sites
MEIYARASU19 0 Report post Posted April 17 On 11/26/2014 at 3:02 PM, Guest said: Add the following codes (change to your needs) into "hmcustom.tcl" : set mypath "C:/Users/MYNAME/myscripts"; set top_menu [hm_framework getpulldowns] catch {$top_menu delete [.hmMainMenuBar index "MyMenu"]} catch {destroy $top_menu.custom} menu $top_menu.custom -tearoff 0 $top_menu insert 20 cascade -label "MyMenu" -menu $top_menu.custom set cat1 $top_menu.custom $cat1 add cascade -label "Category 1" -underline 0 -menu [menu $cat1.mnu1 -title "Cat-1"] $cat1.mnu1 add command -label "Script 1" -command "source {$mypath/script1.tcl}" -underline 0 $cat1.mnu1 add command -label "Script 2" -command "source {$mypath/script2.tcl}" -underline 0 $top_menu.custom add separator set cat2 $top_menu.custom $cat2 add cascade -label "Category 2" -underline 0 -menu [menu $cat2.mnu2 -title "Cat-2"] $cat2.mnu2 add command -label "Script 21" -command "source {$mypath/script21.tcl}" -underline 0 $cat2.mnu2 add command -label "Script 22" -command "source {$mypath/script22.tcl}" -underline 0 Start HM and you get your customized menus, see screenshot. hello, i am new to this forum. please can you tell me how to use this option? thank you , Quote Share this post Link to post Share on other sites
Tvms 0 Report post Posted July 11 I have run this script the option (my menu) is opening in hm but the script is not taking from set mypath "E:/vedio/scripts"; and when I press the category 1. -tria per node.tcl it shows error (no such file or directory) like already showed in image. Quote Share this post Link to post Share on other sites