Allegro System Capture App Notes

Adding Custom Menus

Issue link: https://resources.pcb.cadence.com/i/1180228

Contents of this Issue

Navigation

Page 5 of 10

Adding Custom Menus to Allegro System Capture Learn more at Cadence Support Portal - https://support.cadence.com © 2019 Cadence Design Systems, Inc. All rights reserved w orldw ide. Page 6 Adding an Action To add a custom action to a menu, use the following Tcl API: # add actions to pop-up menus addActionToMenu In the following snippet, an action is added to the pop-up menu. Clicking this menu item will display the string "In custom action" in the Command window. # define a new Tcl procedure "customAction" proc customAction {} { puts "In custom action" } # set the pop-up menu name set popupMenu {Pop- Up} # set the action name set customAction {Custom Action} # set the icon for the action if you have # an icon file customIcon.png set iconFile [file normalize customIcon.png] # add the action to the pop-up menu with the tooltip # "Custom action in pop-up menu" having an icon # customIcon.png addActionToMenu $popupMenu $customAction ::customAction \ $::iconFile {Custom action in pop-up menu} {} {sch} The next section illustrates a sample Tcl script to create a top-level menu containing a pop-up menu and the actions associated with it.

Articles in this issue

Links on this page

view archives of Allegro System Capture App Notes - Adding Custom Menus