Hey, I really tried to get this to run, but I don’t really get what is used for what, if you had a simple slider code like this:
import Rhino
import scriptcontext
import System
import Rhino.UI
import Eto
import Eto.Drawing as drawing
import Eto.Forms as forms
class EtoFormSliderTest(forms.Dialog[bool]):
def __init__(self):
super().__init__()
self.Title = "Sample Slider Eto Test"
self.Padding = drawing.Padding(5)
self.ClientSize = drawing.Size(300,50)
self.Resizable = True
self.sliderTest = forms.Slider()
self.sliderTest.MinValue = 1
self.sliderTest.MaxValue = 4000
self.sliderTest.Value = 170
self.sliderTest.ValueChanged += self.OnSliderValueChanged
self.sliderLabelTest = forms.Label()
self.sliderLabelTest.Text = str(self.sliderTest.Value)
layout= forms.DynamicLayout()
layout.AddRow(None)
layout.AddRow(self.sliderTest)
layout.AddRow(self.sliderLabelTest)
self.Content = layout
def OnSliderValueChanged(self,sender,e):
self.sliderLabelTest.Text = str(self.sliderTest.Value)
def OpenEtoWindow():
form = EtoFormSliderTest()
Rhino.UI.EtoExtensions.ShowSemiModal(form, Rhino.RhinoDoc.ActiveDoc, Rhino.UI.RhinoEtoApp.MainWindow)
if __name__ == '__main__':
OpenEtoWindow()
and you wanted to have the constantly update value as “a” output, what would you need to change?
I tried the Method in this thread but couldn’t get it to run: