本文整理汇总了Python中efl.elementary.button.Button._callback_add方法的典型用法代码示例。如果您正苦于以下问题:Python Button._callback_add方法的具体用法?Python Button._callback_add怎么用?Python Button._callback_add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.button.Button
的用法示例。
在下文中一共展示了Button._callback_add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: genlist_clicked
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import _callback_add [as 别名]
def genlist_clicked(obj, item=None):
win = StandardWindow("Genlist", "Genlist test", autodel=True)
bx = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(bx)
bx.show()
gl = Genlist(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
gl.callback_selected_add(_gl_selected, "arg1", "arg2",
kwarg1="kwarg1", kwarg2="kwarg2")
gl.callback_clicked_double_add(_gl_clicked_double, "arg1", "arg2",
kwarg1="kwarg1", kwarg2="kwarg2")
gl.callback_longpressed_add(_gl_longpressed, "arg1", "arg2",
kwarg1="kwarg1", kwarg2="kwarg2")
bx.pack_end(gl)
gl.show()
over = Rectangle(win.evas_get())
over.color_set(0, 0, 0, 0)
over.event_callback_add(evas.EVAS_CALLBACK_MOUSE_DOWN, _gl_over_click, gl)
over.repeat_events_set(True)
over.show()
over.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND)
win.resize_object_add(over)
vbx = Box(win, horizontal=True)
bx.pack_end(vbx)
vbx.show()
itc1 = GenlistItemClass(item_style="default",
text_get_func=gl_text_get,
content_get_func=gl_content_get,
state_get_func=gl_state_get)
bt_50 = Button(win, text="Go to 50")
vbx.pack_end(bt_50)
bt_50.show()
bt_1500 = Button(win, text="Go to 1500")
vbx.pack_end(bt_1500)
bt_1500.show()
for i in range(0, 2000):
gli = gl.item_append(itc1, i, func=gl_item_sel)
if i == 50:
bt_50._callback_add("clicked", lambda bt, it: it.bring_in(), gli)
elif i == 1500:
bt_1500._callback_add("clicked", lambda bt, it: it.bring_in(), gli)
win.resize(480, 800)
win.show()