Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4152

How to run Eto Form in parallel with Rhino?

$
0
0

When I initialize an Eto Form, how to make Rhino still usable when Eto Form is running?

import Rhino
import Eto.Drawing as drawing
import Eto.Forms as forms
class Dialog_Rhino(forms.Dialog[bool]):
    def __init__(self):
        self.Title = "Eto Form"
        self.ClientSize = drawing.Size(400, 200)
        self.Padding = drawing.Padding(5)
        self.Resizable = False
        layout = forms.DynamicLayout()
        layout.Spacing = drawing.Size(5, 5)
        layout.AddRow(None, self.create_button("TEST A"), self.create_button("TEST B"), self.create_button("TEST C"))
        self.Content = layout
    def create_button(self, text):
        button = forms.Button()
        button.Text = text
        button.Click += lambda sender, e: forms.MessageBox.Show(self, "YOU PRESS: " + text)
        return button
def show_dialog():
    dialog = Dialog_Rhino()
    rc = dialog.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)
    if rc:
        # Your logic for processing the dialog result
        pass
if __name__ == "__main__":
    show_dialog()

Rhino is not usable.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4152

Trending Articles