• 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. hiInsertMenuItem Error When Adding Custom Menu to CIW with...

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 5294
  • 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

hiInsertMenuItem Error When Adding Custom Menu to CIW with .cdsinit

sts
sts over 1 year ago

Hi,

When I loading below code with SKILL IDE it adds a custom menu to CIW window and doesn't give any error for IC23.1-64b.ISR3.27. However, for again same Virtuoso version if I load the code at .cdsinit it still adds the menu to CIW but also gives below error at CIW which I have no idea.

*Error* hiInsertMenuItem: argument #1 should be a defstruct (type template = "rgg") - nil


Then, I changed Virtuoso version to 6.1.8-64b-500.27 and loading the code with both IDE and .cdsinit worked properly without any error.

;;; creating menu items for the slider menu
trA_MenuItem = hiCreateMenuItem(
   ?name  'trA_MenuItem
   ?itemText "A"
   ?callback "println('A)" ;;; prints A in the CIW
)
trB_MenuItem = hiCreateMenuItem(
   ?name 'trB_MenuItem
   ?itemText "B"
   ?callback "println('B)" ;;; prints B in the CIW
)
trC_MenuItem = hiCreateMenuItem(
   ?name 'trC_MenuItem
   ?itemText "C"
   ?callback "println('C)" ;;; prints C in the CIW
)
;;; building the slider menu
hiCreatePulldownMenu(
   'trSubMenu
   ""
   list( ; the list of menu items in the slider menu
      trA_MenuItem
      trB_MenuItem
      trC_MenuItem
   )
)
;;; creating the first menu item for the pulldown menu
trSliderMenuItem = hiCreateSliderMenuItem(
   ?name 'trSliderMenuItem
   ?itemText "Print"
   ?subMenu trSubMenu
)
;;; creating the second menu item for the pulldown menu
trMenuItemResize = hiCreateMenuItem(
   ?name 'trMenuItemResize
   ?itemText "Resize"
   ?callback "hiResizeWindow( window(1) list(0:0 500:500))"
)
;;; creating the Example Menu pulldown menu
hiCreatePulldownMenu(
   'trPulldownMenu
   "Example Menu"
   list( trSliderMenuItem trMenuItemResize )
)
;;; inserting the pulldown menu in the CIW
hiInsertBannerMenu( window(1) trPulldownMenu 0 )

Thanks in advance,

Sedat

  • Cancel
Parents
  • AurelBuche
    AurelBuche over 1 year ago

    Hi

    This kind of errors might occurs when the graphical environment is not fully loaded yet

    you should queue your final call using hiEnqueueCmd to make sure everything is properly setup before inserting your menu

    cheers

    Aurelien

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to AurelBuche

    Actually, adding menus in the .cdsinit should be fine; the need to use hiEnqueueCmd (as Aurélien suggested) is something you need to do if you are popping up forms or dialog boxes. Menus should be fine (you just have to call ciwMenuInit() first). 

    Anyway, the problem here is caused by a change in IC23.1 related to some code for Virtuoso RF - there's an assumption in the code that the left-most menu is the File menu and it breaks if that's not the case. If you change the last line:

    hiInsertBannerMenu( window(1) trPulldownMenu 0 )

    to:

    hiInsertBannerMenu( window(1) trPulldownMenu 1 )

    then everything works fine. I'll file a CCR to get our code made more robust to tolerate the File not being the first pulldown menu.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to AurelBuche

    Actually, adding menus in the .cdsinit should be fine; the need to use hiEnqueueCmd (as Aurélien suggested) is something you need to do if you are popping up forms or dialog boxes. Menus should be fine (you just have to call ciwMenuInit() first). 

    Anyway, the problem here is caused by a change in IC23.1 related to some code for Virtuoso RF - there's an assumption in the code that the left-most menu is the File menu and it breaks if that's not the case. If you change the last line:

    hiInsertBannerMenu( window(1) trPulldownMenu 0 )

    to:

    hiInsertBannerMenu( window(1) trPulldownMenu 1 )

    then everything works fine. I'll file a CCR to get our code made more robust to tolerate the File not being the first pulldown menu.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • sts
    sts over 1 year ago in reply to Andrew Beckett

    Thanks

    I inserted custom menu to position 1 without using hiEnqueueCmd command and it give no error at CIW as you said. However, I wonder if I insist to insert the custom menu to 0 position and use hiEnqueueCmd command so I see no error at CIW. Will it cause Virtuoso RF to misbehave or will it work totally?

    Sedat

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to sts

    Hi Sedat,

    If you use hiEnqueueCmd and leave it in position 0, then there would be no problem with Virtuoso RF. If you leave it at position 0 and don't enqueue it, then the File->Import menu would be missing the ability to import the Allegro database (that's what fails).

    I don't see a terribly good reason to add a custom menu in the left-most position though. It rather disturbs standard usage of the tools which is to have the File menu first. I have however filed a change request, CCR 2925943, to get this fixed. It shouldn't fail...

    Andrew

    • 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