def __init__(self, label="", attachment = "top", pressed_offset = 0, **kwargs): ToggleButton.__init__(self, label=label, pressed_offset = pressed_offset, **kwargs) self.attachment = attachment self.interactive = True self.force_vertical_image = True
def __init__(self, rows = [], dropdown_height=None, open_below = True, overflow = pango.EllipsizeMode.END, **kwargs): ToggleButton.__init__(self, overflow = overflow, **kwargs) if dropdown_height: self.dropdown_height = dropdown_height self.padding_right = self.drop_mark_width self._scene_mouse_down = None # scene mouse down listener to hide our window if clicked anywhere else self._echo = False self.listitem = self.DropdownClass(select_on_drag = True) self.connect_child(self.listitem, "on-mouse-move", self._on_listitem_mouse_move) self.connect_child(self.listitem, "on-mouse-up", self._on_listitem_mouse_up) self.connect_child(self.listitem, "on-select", self._on_listitem_select) #: the list of text strings available for selection self.rows = rows #: Whether the dropdown should appear below or over the input element self.open_below = open_below if rows: self._set_label(self.label or rows[0]) self.scrollbox = ScrollArea(fill=False) self.scrollbox.add_child(self.listitem) self.connect("on-mouse-move", self.__on_mouse_move) self.connect("on-mouse-down", self.__on_mouse_down) self.connect("on-click", self.__on_click) self.connect("on-toggle", self._on_toggle) self.connect("on-key-press", self._on_key_press) self._echo_up = False
def __init__(self, label="", attachment="top", pressed_offset=0, **kwargs): ToggleButton.__init__(self, label=label, pressed_offset=pressed_offset, **kwargs) self.attachment = attachment self.interactive = True self.force_vertical_image = True
def __init__(self, rows=[], dropdown_height=None, open_below=True, overflow=pango.EllipsizeMode.END, **kwargs): ToggleButton.__init__(self, overflow=overflow, **kwargs) if dropdown_height: self.dropdown_height = dropdown_height self.padding_right = self.drop_mark_width self._scene_mouse_down = None # scene mouse down listener to hide our window if clicked anywhere else self._echo = False self.listitem = self.DropdownClass(select_on_drag=True) self.connect_child(self.listitem, "on-mouse-move", self._on_listitem_mouse_move) self.connect_child(self.listitem, "on-mouse-up", self._on_listitem_mouse_up) self.connect_child(self.listitem, "on-select", self._on_listitem_select) #: the list of text strings available for selection self.rows = rows #: Whether the dropdown should appear below or over the input element self.open_below = open_below if rows: self._set_label(self.label or rows[0]) self.scrollbox = ScrollArea(fill=False) self.scrollbox.add_child(self.listitem) self.connect("on-mouse-move", self.__on_mouse_move) self.connect("on-mouse-down", self.__on_mouse_down) self.connect("on-click", self.__on_click) self.connect("on-toggle", self._on_toggle) self.connect("on-key-press", self._on_key_press) self._echo_up = False