Thanks for the reply.
I have modified the code a little bit.
What i wanna do is to change the geometries’ parameters with eto sliders. I hope I can see them changing when sliding the slider (i.e. the slider value keeps update). also, next time i open the slider form, it will be the value I set previously
And it would be great if I can change the viewport in Rhino windows when the eto form is on.
I have hard time to understand the methods’ manual because they do not provide python codes
/ ____ \
If you want to interact with Rhino, you need to use a modeless form any modal form will block the parent forms.
If you use a modeless form you will face another problem, I don’t know why but it seems that TopMost property of Eto.Forms does not work as it supposes to. Rhino.UI.EtoExtensions.ShowSemiModal() will allow the user to interact with the main Rhino window while keeping it on top but the problem is it will block grasshopper.
Long story short, there might be better approaches:
Is there a specific reason you choose to run your own undocumented eto-in-grasshopper solution?
Maybe the HumanUI plugIn can do what you want to achieve, it would certainly be way easier to implement, see: https://www.food4rhino.com/app/human-ui
Some advice on your current solution:
An EtoView inheriting from Dialog is blocking the ui until closed, so you will never see live changes while it is open, you can’t even interact with grasshopper in any way while it is open
You would rather need to inherit from Form as this has a ModelessShow Method
You would also still need to subscribe to the sliders ValueChanged event, as I pointed out in my other answer
If you get that working you will have tell your grasshopper scripting component to update its output, but if you just call SolveInstance it will re-compute again giving you more Forms vor every slider change event
So you will also need to store your view in the sc.sticky dictionary and do some logical if - else cases to get your results of the fired events
All in all using HumanUI would be a lot easier, or if you are interested in the Eto technology, try doing what the developer samples do first and build Rhino-Python scripts before tackling grasshopper as this will add an additional layer of complexity on top.
btw, i found that the human ui has similar problems. it doesn’t update the slider’s value dynamically. and when i press refresh in grasshopper documents, all value will back to default value.
i struggle on this for a long time. i also try to control the number slider with its guid in ghpython, but it seems make a lot of errors and breakpoints
thats why i try eto
thanks again for the solution =)