12.9. get_menu_item_str()
get_menu_item_str(,)
Returns the string value of the menu’s entry
The ID of the menu that you want to modify
The index (not value) of the menu item
Remarks
The
is defined by the order in which the menu items are added within the init callback; it
can’t be changed afterwards.
Examples
on init
declare ui_menu $menu
add_menu_item ($menu, "First Entry",0)
add_menu_item ($menu, "Second Entry",5)
add_menu_item ($menu, "Third Entry",10)
declare ui_button $button
end on
on ui_control ($button)
message(get_menu_item_str (get_ui_id($menu),1))
end on
Displays the message “Second Entry” when clicking on the button
Do'stlaringiz bilan baham: |