• 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. One bindkeys for performance of two functions

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 142
  • Views 6867
  • 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

One bindkeys for performance of two functions

Slawa
Slawa over 14 years ago

Hello

For example there is some VerticalFixedMenu with a name the TEST

procedure(TEST_MENU()
hiDisplayFixedMenu(TEST
"top"
500
500
)
hiSetBindKey("Command Interpreter" "Ctrl<Key>p" "TEST_MENU()")

Whether it is possible that similar BindKey also closed the given window operating by a principle hiFixedMenuDown (TEST)?

 

Regards

Slawa

  • Cancel
Parents
  • skillUser
    skillUser over 14 years ago

     Hi Slawa,

    Ok, now I understand - this is possible but a little tricky.  Here's some code that I wrote and tested successfully:

    
    procedure(toggleTestMenu() 
    let( (one two)
      if(boundp('TEST) && hiIsInstantiated(TEST)
      then 
        hiFixedMenuDown(TEST) 
        TEST = 'unbound
      else
        one = hiCreateMenuItem(?name 'one ?itemText "One" ?callback "printf(\"One\\n\")")
        two = hiCreateMenuItem(?name 'two ?itemText "Two" ?callback "printf(\"Two\\n\")")
        TEST = hiCreateVerticalFixedMenu(
                  'TEST 
                  list(one two) 2 1
                )
        hiDisplayFixedMenu(TEST "top" 500 500)
      ); if
    ); let
    ); procedure
    
    

    Then your bindkey would just call the toggleTestMenu().  The global symbol holding the menu needs to be undefined using 'unbound because the function hiIsInstantiated() returns t as long as the menu has been instantiated (displayed) once, even if it is no longer currently displayed!  So the workaround is to recreate the menu each time it is needed.  The unfortunate side effect is that if the menu was dismissed using the automatically added "Done" button, you need to press the bindkey twice to re-display the menu again.

    I hope that this answers your question.

    Best Regards,

    Lawrence

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 14 years ago

     Hi Slawa,

    Ok, now I understand - this is possible but a little tricky.  Here's some code that I wrote and tested successfully:

    
    procedure(toggleTestMenu() 
    let( (one two)
      if(boundp('TEST) && hiIsInstantiated(TEST)
      then 
        hiFixedMenuDown(TEST) 
        TEST = 'unbound
      else
        one = hiCreateMenuItem(?name 'one ?itemText "One" ?callback "printf(\"One\\n\")")
        two = hiCreateMenuItem(?name 'two ?itemText "Two" ?callback "printf(\"Two\\n\")")
        TEST = hiCreateVerticalFixedMenu(
                  'TEST 
                  list(one two) 2 1
                )
        hiDisplayFixedMenu(TEST "top" 500 500)
      ); if
    ); let
    ); procedure
    
    

    Then your bindkey would just call the toggleTestMenu().  The global symbol holding the menu needs to be undefined using 'unbound because the function hiIsInstantiated() returns t as long as the menu has been instantiated (displayed) once, even if it is no longer currently displayed!  So the workaround is to recreate the menu each time it is needed.  The unfortunate side effect is that if the menu was dismissed using the automatically added "Done" button, you need to press the bindkey twice to re-display the menu again.

    I hope that this answers your question.

    Best Regards,

    Lawrence

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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