Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

hiCreatePulldownMenu

hiCreatePulldownMenu( 
s_menuHandle 
g_menuTitle 
l_menuItems 
) 
=> r_hiMenu 

Description

Creates a pulldown menu that contains text, icon, or slider menu items. s_menuHandle is the SKILL symbol set to the created menu.

After you create a pulldown menu, you need to add it to the menu bar of a window using hiInsertBannerMenu, or insert it as a submenu using hiCreateSliderMenuItem. You can share pulldown menus by placing the same menu in different windows.

A pulldown menu is a tear-off menu by default, it can be detached from the menu bar or the main menu and displayed in its own window anywhere on the screen.

Arguments

s_menuHandle

A unique global SKILL symbol used to reference this menu.

g_menuTitle

Title that is displayed in the menu bar. This can be either a text string or an icon.

If you specify a text string, to set the access key for the menu, add an ampersand before the desired letter in the menu title. For example, if the menu title is Edit and you want E to be the access key for the menu, you would specify this argument as "&Edit".

l_menuItems

List of menu items created by hiCreateMenuItem, hiCreateSliderMenuItem, hiCreateSeparatorMenuItem, or hiCreateAction.

Value Returned

r_hiMenu

The SKILL structure representing the menu. The menuHandle can be referenced by menu->hiMenuSym.

Examples

Creates a pulldown menu named Navigation and inserts it in the leftmost position of the CIW menu banner. If you select the Navigation-Raise Current Window, the current window is raised to the top of the screen.

hiCreatePulldownMenu(
    ’trPulldownMenu
    "Example Menu"
    list ( trMenuItemOne trMenuItemTwo )
    )
;;; Creating a new window to be used as the current window
hiOpenWindow()
;;; creating the "Raise Current Window" menu item
trRaiseCurrentWindow = hiCreateMenuItem(
?name 'trRaiseCurrentWindow
?itemText "Raise Current Window"
?callback "hiRaiseWindow( hiGetCurrentWindow() )"
)
;;; creating the Navigation pulldown menu hiCreatePulldownMenu(    'trPulldownMenu ;;; menu handle
"Navigation" ;;; menu title
list( trRaiseCurrentWindow)
"" ;;; empty help string
) ; hiCreatePulldownMenu
;;; inserting the pulldown menu in the CIW hiInsertBannerMenu(
window( 1 )
trPulldownMenu
0
)

To remove the Navigation pulldown menu from the CIW menu banner use the following command:

hiDeleteBannerMenu( window(1) 0 )

Creates a pulldown menu named Example Menu. The first menu item of this pulldown menu is a slider menu item that prints the letters A, B, or C when selected. The second menu item resizes the CIW.

;;; 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 )

To test the sample menu, from the Example Menu pulldown menu, select Print. Selecting each letter in the slider menu displays it in the CIW. Selecting the Resize menu item from the pulldown menu resizes the CIW.

To delete the Example Menu:

hiDeleteBannerMenu( window(1) 0 )

Related Topics

Menu Functions

hiInsertBannerMenu

hiInsertBannerMenu

hiCreateSliderMenuItem


Return to top
 ⠀
X