def signal_clicked_cb(self, gl, item): pp = Popup(self._parent) pp.part_text_set('title,text', 'Signal content') en = Entry(self, text=prettify_if_needed(item.data['args'])) en.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND en.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL en.size_hint_min = 800, 800 # TODO: this should be respected :/ en.editable = False en.scrollable = True pp.content = en bt = Button(pp, text="Close") bt.callback_clicked_add(lambda b: pp.delete()) pp.part_content_set('button2', bt) def prettify_clicked_cb(chk): options.pretty_output = chk.state en.text = prettify_if_needed(item.data['args']) ck = Check(pp, text="Prettify") ck.state = options.pretty_output ck.callback_changed_add(prettify_clicked_cb) pp.part_content_set('button1', ck) pp.show()
def ask_what_to_do_next(self): pop = Popup(self) pop.part_text_set('title,text', _('Extract completed')) box = Box(pop) pop.content = box box.show() lb = Label(pop, text=_('What to do next?'), size_hint_align=FILL_HORIZ) box.pack_end(lb) lb.show() btn = Button(pop, text=_('Open Filemanager'), size_hint_align=FILL_HORIZ) btn.callback_clicked_add(self._open_fm_and_exit_cb) box.pack_end(btn) btn.show() btn = Button(pop, text=_('Open Terminal'), size_hint_align=FILL_HORIZ) btn.callback_clicked_add(self._open_term_and_exit_cb) box.pack_end(btn) btn.show() btn = Button(pop, text=_('Close this popup'), size_hint_align=FILL_HORIZ) btn.callback_clicked_add(lambda b: pop.delete()) box.pack_end(btn) btn.show() btn = Button(pop, text=_('Exit'), size_hint_align=FILL_HORIZ) btn.callback_clicked_add(lambda b: self.app.exit()) box.pack_end(btn) btn.show() pop.show()
def _popup_build(self): popup = Popup(self.top_widget) popup.part_text_set('title,text', 'Choose the color for %s' % self._tag_name) popup.callback_block_clicked_add(lambda p: popup.delete()) cs = Colorselector(popup, color=self._rect.color) cs.callback_changed_add(lambda s: setattr(rect, 'color', cs.color)) popup.content = cs rect = Rectangle(popup.evas, color=self._rect.color) frame = Frame(popup, style='pad_small', content=rect) popup.part_content_set('button1', frame) bt = Button(popup, text='Accept') bt.callback_clicked_add(self._popup_accept_cb, popup, cs) popup.part_content_set('button2', bt) bt = Button(popup, text='Cancel') bt.callback_clicked_add(lambda b: popup.delete()) popup.part_content_set('button3', bt) popup.show()