• 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. IC1616 Custom Toolbar Icons That Change on State

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 13480
  • 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

IC1616 Custom Toolbar Icons That Change on State

mrharris
mrharris over 5 years ago

I would like to add a toolbar icon that when selected toggles gravity on and off. I have this working through the customization form. As an enhancement I would like the ICON to indicate if gravity is enabled or not instead of looking at the log window to determine this. How would one write a callback such that it updates the icon used based on the state of whether gravity is enabled or not? 

Thanks, 

Micky Harris

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Hi Micky,

    If you mark the Action as "checkable" then it will automatically toggle the icon each time you press it. Does that do what you want?

    Andrew.

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

    That will gray it out vs not, similar to a press button. I was curious if there was a way to have the icon change similar to the partial vs full selection and entry mode. For example a black G for off and a green G for on. 

    Thanks,

    Micky

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

    Micky,

    In the callback for your toolbar action, you would need to do something like this (this is not the code for the partial/full-selection icon, but it's similar to this idea):

    let((win swin optionToolbar action)
      win=hiGetCurrentWindow()
      swin=hiGetSessionWindow(win)
      optionToolbar=car(exists(toolbar hiGetWindowToolbars(swin) hiGetToolbarObjName(toolbar)=="Options"))
      action=optionToolbar->lebSelect
      ; would normally check win~>partialSelect but since changing that 
      ; has a trigger to change the icon, show the principle by using a global variable that you can set to try this out
      if(boundp('PARTIAL_SELECT) && PARTIAL_SELECT then
        action->hiIcon="vertex-select-partial.png"
        action->hiToolTip="Partial Select"
      else
        action->hiIcon="vertex-select-full.png"
        action->hiToolTip="Full Select"
      )
    )

    Hope that helps!

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to mrharris

    Micky,

    In the callback for your toolbar action, you would need to do something like this (this is not the code for the partial/full-selection icon, but it's similar to this idea):

    let((win swin optionToolbar action)
      win=hiGetCurrentWindow()
      swin=hiGetSessionWindow(win)
      optionToolbar=car(exists(toolbar hiGetWindowToolbars(swin) hiGetToolbarObjName(toolbar)=="Options"))
      action=optionToolbar->lebSelect
      ; would normally check win~>partialSelect but since changing that 
      ; has a trigger to change the icon, show the principle by using a global variable that you can set to try this out
      if(boundp('PARTIAL_SELECT) && PARTIAL_SELECT then
        action->hiIcon="vertex-select-partial.png"
        action->hiToolTip="Partial Select"
      else
        action->hiIcon="vertex-select-full.png"
        action->hiToolTip="Full Select"
      )
    )

    Hope that helps!

    Andrew.

    • 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