本文整理汇总了Python中efl.elementary.window.StandardWindow.evas_get方法的典型用法代码示例。如果您正苦于以下问题:Python StandardWindow.evas_get方法的具体用法?Python StandardWindow.evas_get怎么用?Python StandardWindow.evas_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.window.StandardWindow
的用法示例。
在下文中一共展示了StandardWindow.evas_get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: genlist_clicked
# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import evas_get [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()
示例2: core_evas_canvas_callbacks_clicked
# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import evas_get [as 别名]
def core_evas_canvas_callbacks_clicked(obj, item=None):
win = StandardWindow("evascanvascbs", "Evas canvas callbacks", autodel=True,
size=(320,320))
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
text = Text(win.evas, text="Events printed on console", size=(300, 30),
color=(0,0,0,255))
text.font_set("Sans", 12)
text.pos = (10, 10)
text.show()
canvas = win.evas_get()
canvas.event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_IN,
events_cb1, "EVAS_CALLBACK_CANVAS_FOCUS_IN")
canvas.event_callback_add(EVAS_CALLBACK_CANVAS_FOCUS_OUT,
events_cb1, "EVAS_CALLBACK_CANVAS_FOCUS_OUT")
canvas.event_callback_add(EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
events_cb2, "EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN")
canvas.event_callback_add(EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
events_cb2, "EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT")
canvas.event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_PRE,
events_cb1, "EVAS_CALLBACK_RENDER_FLUSH_PRE")
canvas.event_callback_add(EVAS_CALLBACK_RENDER_FLUSH_POST,
events_cb1, "EVAS_CALLBACK_RENDER_FLUSH_POST")
canvas.event_callback_add(EVAS_CALLBACK_RENDER_PRE,
events_cb1, "EVAS_CALLBACK_RENDER_PRE")
canvas.event_callback_add(EVAS_CALLBACK_RENDER_POST,
events_cb1, "EVAS_CALLBACK_RENDER_POST")
r2 = Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70))
r2.show()
hbox = Box(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
horizontal=True)
win.resize_object_add(hbox)
hbox.show()
b = Button(win, text="del cbs", size_hint_align=(0.5, 1.0))
hbox.pack_end(b)
b.callback_clicked_add(btn_del_cbs_cb)
b.show()
win.show()
示例3: menu_clicked
# 需要导入模块: from efl.elementary.window import StandardWindow [as 别名]
# 或者: from efl.elementary.window.StandardWindow import evas_get [as 别名]
def menu_clicked(obj):
win = StandardWindow("menu", "Menu test", autodel=True, size=(350, 200))
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
rect = Rectangle(win.evas_get(), color=(0, 0, 0, 0))
win.resize_object_add(rect)
rect.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
rect.show()
menu = Menu(win)
item = menu.item_add(None, "first item", "clock")
item = menu.item_add(None, "second item", "mail-send")
menu_populate_1(menu, item)
menu.item_add(item, "sub menu", "refresh")
rect.event_callback_add(EVAS_CALLBACK_MOUSE_DOWN, menu_show, menu)
win.show()