I've visited the rhino-plugins Newsgroup and saw that somebody has achieved to use panels in a Real Plugin context. But I could not find some code doing so.
To learn this stuff I would be glad to have a scripting approach to this:
I tried:
When I inherit only from StackedDialogPage the RegisterPanel method fails saying you have to iherit from IWin32Interface. When I try to inherite also from Form or Panel I get the error that I cannot inherit from 2 cli types.Code:from Rhino.UI import * from Rhino.PlugIns import * from Rhino.Runtime import * import clr clr.AddReference("System.Drawing") clr.AddReference("System.Windows.Forms") from System.Windows.Forms import Panel class TestPanel(StackedDialogPage):#,Panel):#,Form): def __init__(self): pass def OnActivate(self): print "activate" def OnCreateParent(self,hwnd): print "create ",hwnd #class plugc(PlugIn): # pass #plug = HostUtils.CreatePlugIn(plugc,True) Panels.RegisterPanel(None,TestPanel,"test",None)
Also I am not able to create a plugin Instance on the fly, would I need a plugIn Instance to register the panel?


Reply With Quote