• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X Scripting - TCL
  3. Add tcl script to menu bar in Capture CIS 17.2

Stats

  • State Not Answered
  • Replies 1
  • Subscribers 13
  • Views 5396
  • Members are here 0
More Content

Add tcl script to menu bar in Capture CIS 17.2

smah
smah over 3 years ago

Hi,

Can anyone help me in this.

I have added a popup with an action in the menu bar but I could not set my tcl script to the assigned menu.

I wanted to edit the menu bar and add my own custom tools to it.

Please help me in the scripting so that I can make a menu on which once I click on it then it runs the whole program.

Regards

  • Cancel
  • Sign in to reply
  • Diego cmre
    0 Diego cmre over 3 years ago

    try following...  

    regards

    namespace eval ::dgo_menu {

    proc RegisterActions { args } {
    catch {

    RegisterAction "dgo_menu_PM_1" "::dgo_menu::shouldProcess" "Alt+F" "::dgo_menu::dgo_menuMePM" "PM"
    RegisterAction "dgo_menu_PM_2" "::dgo_menu::shouldProcess" "Alt+F1" "::dgo_menu::dgo_menuMePM" "PM"
    RegisterAction "dgo_menu_PM_3" "::dgo_menu::shouldProcess" "Alt+F2" "::dgo_menu::dgo_menuMePM" "PM"
    RegisterAction "dgo_menu_PM_4" "::dgo_menu::shouldProcess" "Shift+Z" "::dgo_menu::dgo_menuMePM" "PM"

    RegisterAction "dgo_menu_SCM_1" "::dgo_menu::shouldProcess" "Alt+F" "::dgo_menu::dgo_menuMeSCM" "SCHEMATIC"
    RegisterAction "dgo_menu_SCM_2" "::dgo_menu::shouldProcess" "Alt+F1" "::dgo_menu::dgo_menuMeSCM" "SHEMATIC"
    RegisterAction "dgo_menu_SCM_3" "::dgo_menu::shouldProcess" "Alt+F2" "::dgo_menu::dgo_menuMeSCM" "SCHEMATIC"
    RegisterAction "dgo_menu_SCM_4" "::dgo_menu::shouldProcess" "Shift+Z" "::dgo_menu::dgo_menuMeSCM" "SCHEMATIC"

    InsertXMLMenu [list [list "DgoMenu"] "" "" [list "popup" "DGO TCL" "" "" "" "" ""] ""]

    InsertXMLMenu [list [list "DgoMenu" "Lev_1_1"] "" "" [list "popup" "Lev_1_1" "" "" "" "" ""] ""]
    InsertXMLMenu [list [list "DgoMenu" "Lev_1_2"] "" "" [list "popup" "Lev_1_2" "" "" "" "" ""] ""]

    InsertXMLMenu [list [list "DgoMenu" "Lev_1_1" "Lev_1_1_1"] "" "" [list "action" "&menu1" "0" "ActionForMenu1" "Enable_forMenu1" "Ctrl+Z" "" "" "This is my menu dgo_menu2"] ""]
    InsertXMLMenu [list [list "DgoMenu" "Lev_1_1" "Lev_1_1_2"] "" "" [list "action" "&menu2" "0" "ActionForMenu1" "Enable_forMenu1" "Shift+B" "" "" "This is my menu dgo_menu2"] ""]
    InsertXMLMenu [list [list "DgoMenu" "Lev_1_1" "Lev_1_1_3"] "" "" [list "action" "&menu3" "0" "ActionForMenu1" "Enable_forMenu1" "Shift+X" "" "" "This is my menu dgo_menu2"] ""]

    InsertXMLMenu [list [list "DgoMenu" "Lev_1_2" "Lev_1_2_1"] "" "" [list "action" "&menu4" "0" "ActionForMenu1" "Enable_forMenu1" "Shift+Q" "" "" "This is my menu dgo_menu2"] ""]
    InsertXMLMenu [list [list "DgoMenu" "Lev_1_2" "Lev_1_2_2"] "" "" [list "action" "&menu5" "0" "ActionForMenu1" "Enable_forMenu1" "Ctrl+F" "" "" "This is my menu dgo_menu2"] ""]
    InsertXMLMenu [list [list "DgoMenu" "Lev_1_2" "MySeparator1"] "1" "MyFileLevelAction1" [list "separator"] ""]
    InsertXMLMenu [list [list "DgoMenu" "Lev_1_2" "Lev_1_2_3"] "" "" [list "action" "&menu6" "0" "ActionForMenu1" "Enable_forMenu1" "Alt+F" "" "" "This is my menu dgo_menu2"] ""]

    RegisterAction "ActionForMenu1" "::dgo_menu::shouldProcess" "" "::dgo_menu::dgo_menuActionProc1" ""
    RegisterAction "Enable_forMenu1" "::dgo_menu::shouldProcess" "" "::dgo_menu::dgo_menuEnablerProc1" ""
    RegisterAction "ActionForMenu2" "::dgo_menu::shouldProcess" "" "::dgo_menu::dgo_menuActionProc2" ""
    RegisterAction "Enable_forMenu2" "::dgo_menu::shouldProcess" "" "::dgo_menu::dgo_menuEnablerProc2" ""
    }
    }
    proc shouldProcess { args } {
    return 1
    }
    proc shouldProcess1 { args } {
    return 0
    }

    proc dgo_menuMePM { args } {
    puts "CALLED FROM PM WINDOW"
    }

    proc dgo_menuMeSCM { args } {
    puts "CALLED FROM SCHEMATICS"
    }

    proc dgo_menuActionProc1 { args } {
    puts "CALLED FROM MAIN MENU"
    }

    proc dgo_menuEnablerProc1 { args } {
    #puts "dgo_menuEnablerProc1"
    return true
    }

    }
    ::dgo_menu::RegisterActions
    puts "loaded ::dgo_menu::RegisterActions"

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information