MCPcopy Create free account
hub / github.com/rawpython/remi / on_drag

Method on_drag

examples/resizable_panes.py:77–88  ·  view source on GitHub ↗
(self, emitter, x, y)

Source from the content-addressed store, hash-verified

75
76 @gui.decorate_event
77 def on_drag(self, emitter, x, y):
78 if self.active:
79 if self.origin_x == -1:
80 self.origin_x = float(x)
81 self.origin_y = float(y)
82 self.refWidget_origin_w = gui.from_pix(self.refWidget.style['width'])
83 self.refWidget_origin_h = gui.from_pix(self.refWidget.style['height'])
84 else:
85 self.refWidget.style['width'] = gui.to_pix(self.refWidget_origin_w + float(x) - self.origin_x )
86 self.refWidget.style['height'] = gui.to_pix(self.refWidget_origin_h + float(y) - self.origin_y)
87 self.update_position()
88 return ()
89
90 def update_position(self):
91 self.style['position']='absolute'

Callers

nothing calls this directly

Calls 1

update_positionMethod · 0.95

Tested by

no test coverage detected