def __init__(self, ourParent, ourText, ourIcon=None, ourCB=None, *args, **kwargs): Button.__init__(self, ourParent, *args, **kwargs) icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) icon.standard_set(ourIcon) icon.show() self.text = ourText self.content_set(icon) self.callback_clicked_add(ourCB)
def __init__(self, parent, text, *args, ic_btn=None, cb_onclick=None, **kwargs): Button.__init__(self, parent, *args, **kwargs) icon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) icon.standard_set(ic_btn) icon.show() self.text = text self.content_set(icon) if cb_onclick: self.callback_clicked_add(cb_onclick)
def __init__(self, app, parent): self.app = app self._text = '' Button.__init__(self, parent,size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.callback_clicked_add(self._btn_clicked_cb) box = Box(self, horizontal=True, padding=(3,0)) self.content = box box.show() icon = Icon(box, standard='folder', size_hint_min=(16,16)) box.pack_end(icon) icon.show() self.label = Label(box, ellipsis=True, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ) box.pack_end(self.label) self.label.show()
def __init__(self, app, parent): self.app = app self._text = '' Button.__init__(self, parent, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.callback_clicked_add(self._btn_clicked_cb) box = Box(self, horizontal=True, padding=(3, 0)) self.content = box box.show() icon = SafeIcon(box, 'folder', size_hint_min=(16, 16)) box.pack_end(icon) icon.show() self.label = Label(box, ellipsis=True, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ) box.pack_end(self.label) self.label.show()
def __init__(self, app): self.app = app self._menu = None Button.__init__(self, app.win, text='Menu', content=SafeIcon(app.win, 'user-home')) self.callback_pressed_add(self._button_pressed_cb)
def __init__(self, parent): self._menu = None Button.__init__(self, parent, text='Menu', focus_allow=False, content=Icon(parent, standard='home')) self.callback_pressed_add(self._button_pressed_cb)