import Eto
import Eto.Forms
import Eto.Forms as ef
import Eto.Drawing
import Eto.Drawing as ed
import Rhino as rh
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc
import os
class Scroll_Control(ef.Drawable):
def __init__(self, pr=None):
super().__init__()
self.pr = pr
self.L2 = ef.DynamicLayout()
for j in range(80):
lb2 = ef.Label()
lb2.Text = f"Layout{j}"
self.L2.AddRow(lb2)
self.Scrolling_Layout = ef.PixelLayout()
self.Scrolling_Layout.Add(self.L2, ed.PointF(0, 0))
self.Content = self.Scrolling_Layout
self.offset_y = 0 # AddLayoutoffset_y
def OnMouseDown(self, e):
self.offset_y -= 20
self.Moving_Layouts(ed.PointF(0, self.offset_y))
def Moving_Layouts(self, offset):
for ctrl in self.Scrolling_Layout.Controls:
self.Scrolling_Layout.Move(ctrl, offset)
self.Scrolling_Layout.UpdateLayout()
self.Scrolling_Layout.Invalidate()
self.Invalidate()
class FloatingForm(Eto.Forms.FloatingForm):
def __init__(self):
super().__init__()
self.Title = None
self.Topmost = True
self.Height = 180
self.Content = Scroll_Control(pr = self)
if __name__ == "__main__":
form = FloatingForm()
form.Show()
It is not possible to redraw the layout after refreshing the layout again. There is no good idea at present. Have any friends encountered this problem
@curtisw @CallumSykes Sir, do you know where my problem is?
self.Scrolling_Layout.UpdateLayout()
self.Scrolling_Layout.Invalidate()
self.Invalidate()

