def store_clicked(obj): win = StandardWindow("store", "Store") win.autodel = True if obj is None: win.callback_delete_request_add(lambda o: elementary.exit()) bx = Box(win) bx.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND win.resize_object_add(bx) bx.show() gl = Genlist(win) gl.mode = ELM_LIST_COMPRESS gl.callback_selected_add(st_selected) gl.callback_clicked_double_add(st_double_clicked) gl.callback_longpressed_add(st_longpress) gl.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND gl.size_hint_align = EVAS_HINT_FILL, EVAS_HINT_FILL bx.pack_end(gl) gl.show() itc1 = GenlistItemClass() itc1.item_style = "message" st = Store() st.fs_list_func_set(st_store_list) st.fetch_func_set(st_store_fetch) #st.fetch_thread = False #st.unfetch_func_set(st_store_unfetch) st.items_sorted = False st.target_genlist = gl st.filesystem_directory = "." win.size = 480, 800 win.show()
def __init__(self, parent, h): Box.__init__(self, parent) filelist = Genlist(self) filelist.size_hint_align = -1.0, -1.0 filelist.size_hint_weight = 1.0, 1.0 self.populate(filelist, h) filelist.callback_activated_add(self.item_activated_cb) filelist.show() sel_all = Button(self) sel_all.text = "Select all" sel_all.callback_clicked_add(self.select_all_cb, filelist, h, True) sel_all.show() sel_none = Button(self) sel_none.text = "Select none" sel_none.callback_clicked_add(self.select_all_cb, filelist, h, False) sel_none.show() xbtn = Button(self) xbtn.text = "Close" xbtn.callback_clicked_add(lambda x: parent.item_pop()) xbtn.show() btn_box = Box(self) btn_box.horizontal = True btn_box.pack_end(sel_all) btn_box.pack_end(sel_none) btn_box.pack_end(xbtn) btn_box.show() self.pack_end(filelist) self.pack_end(btn_box) self.show()