• 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. Custom IC SKILL
  3. How to add a menu in both the CIW Window and all the layout...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 144
  • Views 15952
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to add a menu in both the CIW Window and all the layout window (on opening) !!!

Sonu Chopra
Sonu Chopra over 5 years ago

Hello ,

I wanted to add a menu in both the CIW Window and all the layout window (on opening). I am able to add either in layout window or in CIW Window (not in both). 

i am writing a dummy example to illustrate this

Skill code to illustrate addition of menu in Layout window :

procedure(AddMenu(args)
  let( (item1 item2)
    ;; create a couple of menu items
    item1 = hiCreateMenuItem( ?name 'item1 ?itemText "My First Item"
              ?callback "AmitFunctionOne()"
            )
    item2 = hiCreateMenuItem( ?name 'item2 ?itemText "My Second Item"
              ?callback "AmitFunctionTwo()"
            )
    ;; create a menu that includes the menu items and return a list of the
    ;; pulldown menus
    list(hiCreatePulldownMenu('AmitMenu "Amit Menu" list(item1 item2)))
  );let
); procedure
;; create a userMenuTrigger trigger that automatically adds the menu
deRegUserTriggers("maskLayout" nil 'AddMenu)

Skill code to add a menu to the CIW Window

procedure(AddMenu()
  let( (item1 item2)
    ;; create a couple of menu items
    item1 = hiCreateMenuItem( ?name 'item1 ?itemText "My First Item"
              ?callback "AmitFunctionOne()"
            )
    item2 = hiCreateMenuItem( ?name 'item2 ?itemText "My Second Item"
              ?callback "AmitFunctionTwo()"
            )
    ;; create a menu that includes the menu items and return a list of the
    ;; pulldown menus
    CiwMenu = hiCreatePulldownMenu('AmitMenu "Amit Menu" list(item1 item2)))

    hiInsertBannerMenu( window(1) CiwMenu  3 )


  );let
); procedure

AddMenu()

Can you please guide me how i can add the menu to both CIW Window and Layout Window (on opening) ?

Regards

Sonu

  • Cancel
  • henker
    henker over 5 years ago

    When you create the second menu using hiCreatePulldownMenu and the same symbol as menu handle, you are implicitely deleting the first. The menu handle is a unique global skill symbol (see documentation). This also means that you can get the menu from anywhere by accessing the symbol 'AmitMenu' in you case.

    So you either have to create the menus with a different menu handles on each creation (not really recommendend), or create the menu only once and insert this once created menu to where you want to have it.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sonu Chopra
    Sonu Chopra over 5 years ago in reply to henker

    Hello henker,

    I am not writing two separate procedures to insert in CIW and Layout Window. (That's why i am not having same symbols as you mentioned).  This was an dummy example to illustrate that I am able to generate menu separately for CIW or layout menu through a procedure. I don't know who I am able to do it with a single procedure and store it in my .cdsinit file.

    Regards

    Sonu

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to Sonu Chopra

    Here's how to do it. Share the code that creates the menu and only create it if it's not already bound:

    procedure(AmitCreateMenu()
      let( (item1 item2)
        ;; create a couple of menu items
        item1 = hiCreateMenuItem( ?name 'item1 ?itemText "My First Item"
                  ?callback "AmitFunctionOne()"
                )
        item2 = hiCreateMenuItem( ?name 'item2 ?itemText "My Second Item"
                  ?callback "AmitFunctionTwo()"
                )
        ;; create a menu that includes the menu items and return a list of the
        ;; pulldown menus
        hiCreatePulldownMenu('AmitMenu "Amit Menu" list(item1 item2))
      )
    )
    
    procedure(AmitAddMenu(args)
      unless(boundp('AmitMenu)
        AmitCreateMenu()
      )
      list(AmitMenu)
    ); procedure
    
    procedure(AmitAddToCIW()
      unless(boundp('AmitMenu)
        AmitCreateMenu()
      )
      hiInsertBannerMenu(hiGetCIWindow() AmitMenu  3 )
    )
    
    ;; create a userMenuTrigger trigger that automatically adds the menu
    deRegUserTriggers("maskLayout" nil 'AmitAddMenu)
    ; may need to initialise CIW menus before adding
    ciwMenuInit()
    AmitAddToCIW()
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sonu Chopra
    Sonu Chopra over 5 years ago in reply to Andrew Beckett

    Hello Andrew,

    Sorry for delay in reply.. thanks for your code and it works fine for him.

    Regards

    Sonu

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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