there seems to be a bug when using above method. It does not show the checkmark state in front of the context menu items. The disabled state seems to work. This applies to the pythonscript example in V5 and V6 for rs.PopupMenu() and to RhinoCommon.
@Alain, thanks. So it seems to be that there is no solution in V5 (Win) and the solution which might someday work in V6 (Win) will never work in V5 but probably on Mac ?
while looking for a solution to this problem for both Rhino 5 and 6 i’ve found that all states of the PopupMenu items are ignored as soon as a seperator is included. Example:
import rhinoscriptsyntax as rs
items = "Line", "", "Circle", "Arc"
modes = 2,0,1,3
result = rs.PopupMenu(items, modes)
if result >= 0:
print items[result]
Once the seperator and it’s mode is removed, at least the disabled state seems to work. However, i am unsure if this will automagically work in V6 if i call the rhinoscript syntax version, eg. when rhinoscriptsyntax uses ETO for it. Making it work in V5 and V6 with the same code seems out of question.