

def button_release_event(self, widget, event):
    x = event.x_root
    y = event.y_root
    button = self.kbdmouse_mask
    if (event.button != 0):
        button |= (1 << (event.button - 1))
    if (self.selected_child is not None):
        bnch = self.selected_child
        subwin = bnch.subwin
        if (bnch.action == 'move'):
            x = int((subwin.x + (x - bnch.dx)))
            y = int((subwin.y + (y - bnch.dy)))
            self.move(subwin.frame, x, y)
            (subwin.x, subwin.y) = self.get_widget_position(subwin.frame)
        elif (bnch.action == 'resize'):
            wd = int((subwin.width + (x - bnch.dx)))
            ht = int((subwin.height + (y - bnch.dy)))
            subwin.frame.set_size_request(wd, ht)
            (subwin.width, subwin.height) = self.get_widget_size(subwin.frame)
        self.selected_child = None
    return True

dataset/ETHPy150Open ejeschke/ginga/ginga/gtkw/GtkHelp.py MDIWidget.button_release_event/original