Rhinoscriptsyntax PopupMenu error

There seems ot be something wrong with this method - using the following script to test:

import rhinoscriptsyntax as rs
def MyTest1():
    print choice    

this errors out with the message:

Message: Value cannot be null.  Parameter name: collection

In stepping into the method, it calls

Rhino.UI.Dialogs.ShowContextMenu(items, screen_point, modes)

This appears to be where the error is occurring, in the “modes” argument, it’s not liking “None”, it seems…
It’s expecting some sort of enumerable. If I run the following (with a mode specified):

import rhinoscriptsyntax as rs
def MyTest2():
    print choice

I get a different error:

Message: expected IEnumerable[str], got list

Anyway, there’s something in there that needs to be fixed, either in the rhinoscript syntax or in RhinoCommon…

And I guess this is a moot point anyway I was trying to design something for the Mac, but I see that the PopupMenu method uses System.Windows.Forms.Cursor.Position, so it’s going to crash on a Mac anyway, I suppose…


Yep, I see the bug and you are correct that this probably won’t work in it’s current form on OSX. I’ll get this fixed for Windows Rhino and will start figuring out what needs to be done to get these rhinoscriptsyntax “user interface” functions working on OSX.