def cb_popup_center_title_text_block_clicked_event(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH) popup.text = "This Popup has title area and content area. " \ "When clicked on blocked event region, popup gets deleted" popup.part_text_set("title,text", "Title") popup.callback_block_clicked_add(cb_bnt_close, popup) popup.show()
def cb_popup_center_title_text_block_clicked_event(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH) popup.text = "This Popup has title area and content area. " \ "When clicked on blocked event region, popup gets deleted" popup.part_text_set("title,text", "Title") popup.callback_block_clicked_add(cb_bnt_close, popup) popup.show()
def cb_popup_center_title_text_1button(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH) popup.text = "This Popup has content area and " \ "action area set, action area has one button Close" bt = Button(win, text="Close") bt.callback_clicked_add(cb_bnt_close, popup) popup.part_content_set("button1", bt) popup.show()
def cb_popup_center_title_text_1button(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH) popup.text = "This Popup has content area and " \ "action area set, action area has one button Close" bt = Button(win, text="Close") bt.callback_clicked_add(cb_bnt_close, popup) popup.part_content_set("button1", bt) popup.show()
def __init__(self, canvas, title, text): n = Popup(canvas) n.part_text_set("title,text", title) n.text = text b = Button(canvas) b.text = "OK" b.callback_clicked_add(lambda x: n.delete()) n.part_content_set("button1", b) n.show()
def pw_error_popup(en): win = en.top_widget_get() popup = Popup(win) popup.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND popup.part_text_set("title,text", "Error") popup.text = "Incorrect Password!<br>Please try again." log.error("eSudo Error: Incorrect Password. Please try again.") popup.timeout = 3.0 popup.show()
def pw_error_popup(en): win = en.top_widget_get() popup = Popup(win) popup.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND popup.part_text_set("title,text", "Error") popup.text = "Incorrect Password!<br>Please try again." log.error("eSudo Error: Incorrect Password. Please try again.") popup.timeout = 3.0 popup.show()
def __init__(self, canvas, exit_func): n = Popup(canvas) n.part_text_set("title,text", "Confirm exit") n.text = "Are you sure you wish to exit Epour?" b = Button(canvas) b.text = "Yes" b.callback_clicked_add(lambda x: exit_func()) n.part_content_set("button1", b) b = Button(canvas) b.text = "No" b.callback_clicked_add(lambda x: n.delete()) n.part_content_set("button2", b) n.show()
def cb_popup_center_title_text_2button_restack(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH) popup.text = "When you click the 'Restack' button, " \ "an image will be located under this popup" popup.part_text_set("title,text", "Title") bt = Button(win, text="Restack") bt.callback_clicked_add(cb_btn_restack, popup) popup.part_content_set("button1", bt) bt = Button(win, text="Close") bt.callback_clicked_add(cb_bnt_close, popup) popup.part_content_set("button3", bt) popup.show()
def cb_popup_center_title_text_2button_restack(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH) popup.text = "When you click the 'Restack' button, " \ "an image will be located under this popup" popup.part_text_set("title,text", "Title") bt = Button(win, text="Restack") bt.callback_clicked_add(cb_btn_restack, popup) popup.part_content_set("button1", bt) bt = Button(win, text="Close") bt.callback_clicked_add(cb_bnt_close, popup) popup.part_content_set("button3", bt) popup.show()
def applyPressed(self, btn): with open(StartupApplicationsFile, 'w') as saf: for i in self.startupList.items_get(): saf.write(i.data["file"]) saf.write("\n") with open(StartupCommandsFile, 'w') as scf: lastI = self.commandsList.last_item_get() for i in self.commandsList.items_get(): if i != lastI: scf.write(i.text + " | \\ \n") else: scf.write(i.text) p = Popup(self, size_hint_weight=EXPAND_BOTH, timeout=3.0) p.text = "Changes Successfully Applied" p.show()
def applyPressed(self, btn): with open(StartupApplicationsFile, 'w') as saf: for i in self.startupList.items_get(): saf.write(i.data["file"]) saf.write("\n") with open(StartupCommandsFile, 'w') as scf: lastI = self.commandsList.last_item_get() for i in self.commandsList.items_get(): if i != lastI: scf.write(i.text + " | \\ \n") else: scf.write(i.text) p = Popup(self, size_hint_weight=EXPAND_BOTH, timeout=3.0) p.text = "Changes Successfully Applied" p.show()
def cb_popup_center_text_1button_hide_show(li, item, win): global times global g_popup times += 1 if g_popup is not None: g_popup.text = "You have checked this popup %d times." % times g_popup.show() return g_popup = Popup(win, size_hint_weight=EXPAND_BOTH) g_popup.text = "Hide this popup by using the button." \ "When you click list item again, you will see this popup again." bt = Button(win, text="Hide") bt.callback_clicked_add(lambda b: g_popup.hide()) g_popup.part_content_set("button1", bt) g_popup.show()
def cb_popup_center_text_1button_hide_show(li, item, win): global times global g_popup times += 1 if g_popup is not None: g_popup.text = "You have checked this popup %d times." % times g_popup.show() return g_popup = Popup(win, size_hint_weight=EXPAND_BOTH) g_popup.text = "Hide this popup by using the button." \ "When you click list item again, you will see this popup again." bt = Button(win, text="Hide") bt.callback_clicked_add(lambda b: g_popup.hide()) g_popup.part_content_set("button1", bt) g_popup.show()
def cb_popup_bottom_title_text_3button(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH, content_text_wrap_type=ELM_WRAP_CHAR) popup.text = "This Popup has title area, content area and " \ "action area set with content being character wrapped. " \ "action area has three buttons OK, Cancel and Close" popup.part_text_set("title,text", "Title") ic = Icon(win, file=os.path.join(img_path, "logo_small.png")) popup.part_content_set("title,icon", ic) bt = Button(win, text="OK") popup.part_content_set("button1", bt) bt = Button(win, text="Cancel") popup.part_content_set("button2", bt) bt = Button(win, text="Close") bt.callback_clicked_add(cb_bnt_close, popup) popup.part_content_set("button3", bt) popup.show()
def cb_popup_bottom_title_text_3button(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH, content_text_wrap_type=ELM_WRAP_CHAR) popup.text = "This Popup has title area, content area and " \ "action area set with content being character wrapped. " \ "action area has three buttons OK, Cancel and Close" popup.part_text_set("title,text", "Title") ic = Icon(win, file=os.path.join(img_path, "logo_small.png")) popup.part_content_set("title,icon", ic) bt = Button(win, text="OK") popup.part_content_set("button1", bt) bt = Button(win, text="Cancel") popup.part_content_set("button2", bt) bt = Button(win, text="Close") bt.callback_clicked_add(cb_bnt_close, popup) popup.part_content_set("button3", bt) popup.show()
def cb_popup_center_text(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH, timeout=3.0) popup.text = "This Popup has content area and timeout value is 3 seconds" popup.show()
def cb_popup_center_text(li, item, win): popup = Popup(win, size_hint_weight=EXPAND_BOTH, timeout=3.0) popup.text = "This Popup has content area and timeout value is 3 seconds" popup.show()