本文整理汇总了Python中efl.elementary.entry.Entry.tooltip_text_set方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.tooltip_text_set方法的具体用法?Python Entry.tooltip_text_set怎么用?Python Entry.tooltip_text_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.entry.Entry
的用法示例。
在下文中一共展示了Entry.tooltip_text_set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tooltip_clicked
# 需要导入模块: from efl.elementary.entry import Entry [as 别名]
# 或者: from efl.elementary.entry.Entry import tooltip_text_set [as 别名]
def tooltip_clicked(obj):
win = StandardWindow("tooltips", "Tooltips", autodel=True, size=(400, 500))
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
bx = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(bx)
bx.show()
tb = Toolbar(win, homogeneous=False, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
bx.pack_end(tb)
tb.show()
ti = tb.item_append("folder-new", "Open", None, None)
ti.tooltip_text_set("Opens a file")
ti = tb.item_append("clock", "Icon", None, None)
ti.tooltip_content_cb_set(_tt_item_icon, None)
ti.tooltip_style_set("transparent")
bt = Button(win, text="Simple text tooltip")
bt.tooltip_text_set("Simple text tooltip")
bx.pack_end(bt)
bt.show()
def _tt_text_replace(obj, data):
value = data.get("value")
if not value:
value = 1
obj.tooltip_text_set("count=%d" % value)
value += 1
data["value"] = value
bt = Button(win, text="Simple text tooltip, click to change")
bt.tooltip_text_set("Initial")
data = dict()
bt.callback_clicked_add(_tt_text_replace, data)
bx.pack_end(bt)
bt.show()
def _tt_text_replace_timer_cb(obj, data):
_tt_text_replace(obj, data)
return True
def _tt_text_replace_timed(obj, data, *args, **kargs):
timer = data.get("timer")
if timer:
timer.delete()
del data["timer"]
obj.text_set("Simple text tooltip, click to start changed timed")
return
data["timer"] = Timer(1.5, _tt_text_replace_timer_cb, obj, data)
obj.text_set("Simple text tooltip, click to stop changed timed")
bt = Button(win, text="Simple text tooltip, click to start changed timed")
bt.tooltip_text_set("Initial")
data = dict()
bt.callback_clicked_add(_tt_text_replace_timed, data)
bx.pack_end(bt)
bt.show()
bt.on_del_add(_tt_timer_del, data)
bt = Button(win, text="Icon tooltip")
bt.tooltip_content_cb_set(_tt_icon, None)
bx.pack_end(bt)
bt.show()
def _tt_icon_replace_timer_cb(obj, data):
value = data.get("value")
data["value"] = not value
if value:
obj.tooltip_content_cb_set(_tt_icon)
else:
obj.tooltip_content_cb_set(_tt_icon2)
return True
def _tt_icon_replace_timed(obj, data, *args, **kargs):
timer = data.get("timer")
if timer:
timer.delete()
del data["timer"]
obj.text_set("Icon tooltip, click to start changed timed")
return
data["timer"] = timer_add(1.5, _tt_icon_replace_timer_cb, obj, data)
obj.text_set("Icon tooltip, click to stop changed timed")
bt = Button(win, text="Icon tooltip, click to start changed timed")
bt.tooltip_content_cb_set(_tt_icon)
data = dict()
bt.callback_clicked_add(_tt_icon_replace_timed, data)
bx.pack_end(bt)
bt.show()
bt.on_del_add(_tt_timer_del, data)
bt = Button(win, text="Transparent Icon tooltip")
bt.tooltip_content_cb_set(_tt_icon, None)
bt.tooltip_style_set("transparent")
bx.pack_end(bt)
bt.show()
#.........这里部分代码省略.........