separator

 

   

Creating User Interfaces - Quick Navigation

A separator is used to place a separator line in the right-click menu, and is normally used to group menu items. The syntax for a separator is:

separator <name> [ filter:<function> ]

Parameters

name:

Used to name an automatically constructed local variable that will hold the value representing the separator.

filter:

A function that returns a Boolean value. The filter function is evaluated when the right-click menu is first opened. If the filter function returns true the separator appears in the menu, otherwise it is not displayed.

EXAMPLE:

rcmenu MyRCmenu
(
fn flt_objects = ($ != undefined) -- objects filter
menuItem mi_cs "Cast Shadows" checked:false
menuItem mi_rs "Receive Shadows" checked:false
-- add only if one or more objects are selected
separator sep1 filter:flt_objects
menuItem mi_st "Scale Twice" filter:flt_objects
menuItem mi_sh "Scale Half" filter:flt_objects
-- event handlers would go here...
)
registerRightClickMenu MyRcmenu -- register the rcmenu 

See Also