def __init__(self, **kwds): Window.__init__(self, **kwds) self.view = TestScrollableView(container=self, x=20, y=20, width=300, height=300) #, scrolling = 'hv') self.view.report_update_rect = True if 1: ### self.h_scrolling_ctrl = CheckBox("Horizontal Scrolling", value='h' in self.view.scrolling, action='horz_scrolling') self.v_scrolling_ctrl = CheckBox("Vertical Scrolling", value='v' in self.view.scrolling, action='vert_scrolling') self.border_ctrl = CheckBox("Border", value=1, action='change_border') CheckBox("Vertical Scrolling", value=1, action='vert_scrolling'), buttons = self.create_buttons() x = self.view.right + 5 y = self.view.top for b in buttons: b.position = (x, y) self.add(b) y = b.bottom + 5 #self.shrink_wrap() self.view.become_target()
def test(): cursor = StdCursors.finger win = Window(title="Cursor", width=500, height=400) view1 = TestDrawing(position=(20, 20), size=(100, 70), cursor=cursor) view2 = TestScrollableView(position=(140, 20), size=(200, 200), scrolling='hv') view2.cursor = cursor win.add(view1) win.place(view2, sticky='nsew') win.shrink_wrap((20, 20)) win.show()
def __init__(self, **kwds): Window.__init__(self, **kwds) view = TestScrollableView(container=self, size=(300, 300), extent=(1000, 1000), scrolling='hv', anchor='ltrb') button = Button("Embedded", action=self.click) off = (300, 300) view.scroll_offset = off button.position = off view.add(button) self.shrink_wrap()
def test(): file = "grail_masked.tiff" #file = "spam_masked.tiff" image = Image(os.path.join(sys.path[0], file)) cursor = Cursor(image) win = Window(title = "Image Cursor", width = 500, height = 400) view1 = TestDrawing(position = (20, 20), size = (100, 70), cursor = cursor) view2 = TestScrollableView(position = (140, 20), size = (200, 200), scrolling = 'hv') view2.cursor = cursor win.add(view1) win.place(view2, sticky = 'nsew') win.shrink_wrap((20, 20)) win.show()