I have a very basic ETO form with a single button which when pressed should print some text. Pressing the button crashes rhino.
import Rhino
import Eto.Drawing as drawing
import Eto.Forms as forms
import rhinoscriptsyntax as rs
class MainWindow(forms.Form):
def __init__(self):
self.Title = "test button"
self.Padding = drawing.Padding(5)
self.Resizable = False
self.buttonTest = forms.Button(Text = "test")
self.buttonTest.Click += self.OnTestButtonClick
layout= forms.DynamicLayout()
layout.AddRow(self.buttonTest)
self.Content = layout
def OnTestButtonClick():
print "it works!!"
def OpenMainWindow():
form = MainWindow()
form.Owner = Rhino.UI.RhinoEtoApp.MainWindow
form.Show()
if __name__ == '__main__':
OpenMainWindow()
testButtonCrash.py (778 Bytes)