Hello guys, someone know how to edit action of close button of eto frame ?
Please supply some code or example. It’s very hard to help without code.
You need to bound a method to .Closing event of your form, here is a small example that can print a custom text in the command window on closing.
import Rhino import Eto.Drawing as drawing import Eto.Forms as forms class SimpleEtoDialog(forms.Dialog): def __init__(self): self.Title = "Sample Eto Dialog" self.ClientSize = drawing.Size(200, 200) self.Padding = drawing.Padding(5) self.Resizable = False self.Closing += self.OnFormClosed def OnFormClosed(self, sender, e): Rhino.RhinoApp.WriteLine("You can do whatever you want here") #self.Close(False) you can even prevent the form from closing def TestSampleEtoDialog(): dialog = SimpleEtoDialog() dialog.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow) if __name__ == "__main__": TestSampleEtoDialog()
Closing.py (705 Bytes)
If you want to know more about Eto forms in Rhino.Python here is a good point to start: