Script selection


#1

Hello,

I found a demonstration video on youtube that shows a pretty good user interface. Regarding the interface I have found the HtmlBox like a possible interface for python script however the one on Youtube has a good advantage that it works parallel with Rhino and the user does not need to close to run the script while at the HtmlBox “the user cannot switch windows until the dialog box is closed”.

Is it an embedded python script in a plugin on youtube or simple python script with a trick?


GUI for Scripts
Eto Dialog() vs Form()
(Dale Fugier) #2

@onrender, the video show a Python script displaying a modeless (e.g. non-blocking) dialog box. The dialog box was created with Eto, which is included with the Rhino WIP.

You can use Eto from within Python. Here is very simple example:

import clr
clr.AddReference("Eto")
clr.AddReference("Rhino.UI")

from Rhino.UI import *
from Eto.Forms import *
from Eto.Drawing import *

obj = Dialog()
obj.Title = "Sample Eto Dialog"
obj.ClientSize = Size(200, 200)
obj.Padding = Padding(5)
obj.Resizable = False

label = Label()
label.Text = "Hello Rhino.Python!"
obj.Content = label

obj.ShowModal(RhinoEtoApp.MainWindow)

https://github.com/picoe/Eto

– Dale


#3

I am just linking this here, in case someone likes to see inside…

c.


#4

Thank you !


#5

@onrender, the Eto package only works on the rhino 6 WIP. if you are using Rhino 5 the script that dale has sent would not work. you can download Rhino 6 WIP in this link. https://www.rhino3d.com/download/rhino/wip


#6

Thanks Arjun, I tried your script already in v6 and was working fine. One thing I did not understand is the definition of the “pop up window” as in Dale’s sample he used Dialog() and you used Form (), I also did not found the parameters in the Eto guide. No clue how it works. Eto Dialog() vs Form()