本文整理汇总了Python中efl.elementary.button.Button.callback_file_chosen_add方法的典型用法代码示例。如果您正苦于以下问题:Python Button.callback_file_chosen_add方法的具体用法?Python Button.callback_file_chosen_add怎么用?Python Button.callback_file_chosen_add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.button.Button
的用法示例。
在下文中一共展示了Button.callback_file_chosen_add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: photocam_clicked
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import callback_file_chosen_add [as 别名]
def photocam_clicked(obj):
win = StandardWindow("photocam", "Photocam test", autodel=True,
size=(600, 600))
if obj is None:
win.callback_delete_request_add(lambda o: elementary.exit())
# Photocam widget
pc = Photocam(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(pc)
pc.show()
# table for buttons
tb = Table(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(tb)
tb.show()
# zoom out btn
bt = Button(win, text="Z -", size_hint_weight=EXPAND_BOTH,
size_hint_align=(0.1, 0.1))
bt.callback_clicked_add(_cb_zoom_out, pc)
tb.pack(bt, 0, 0, 1, 1)
bt.show()
# select file btn
bt = FileselectorButton(win, text="Select Photo File",
size_hint_weight=EXPAND_BOTH, size_hint_align=(0.5, 0.1))
bt.callback_file_chosen_add(lambda fs, path: pc.file_set(path))
tb.pack(bt, 1, 0, 1, 1)
bt.show()
# zoom in btn
bt = Button(win, text="Z +", size_hint_weight=EXPAND_BOTH,
size_hint_align=(0.9, 0.1))
bt.callback_clicked_add(_cb_zoom_in, pc)
tb.pack(bt, 2, 0, 1, 1)
bt.show()
# progressbar for remote loading
pb = Progressbar(win, unit_format="loading %.2f %%",
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
tb.pack(pb, 1, 1, 1, 1)
# Fit btn
bt = Button(win, text="Fit", size_hint_weight=EXPAND_BOTH,
size_hint_align=(0.1, 0.9))
bt.callback_clicked_add(lambda b: pc.zoom_mode_set(ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT))
tb.pack(bt, 0, 2, 1, 1)
bt.show()
# load remote url
bt = Button(win, text="Load remote URL (27MB)",
size_hint_weight=EXPAND_BOTH, size_hint_align=(0.5, 0.9))
bt.callback_clicked_add(lambda b: pc.file_set(remote_url))
tb.pack(bt, 1, 2, 1, 1)
bt.show()
pc.callback_download_start_add(_cb_pc_download_start, pb)
pc.callback_download_done_add(_cb_pc_download_done, pb)
pc.callback_download_progress_add(_cb_pc_download_progress, pb)
pc.callback_download_error_add(_cb_pc_download_error, pb)
# Fill btn
bt = Button(win, text="Fill", size_hint_weight=EXPAND_BOTH,
size_hint_align=(0.9, 0.9))
bt.callback_clicked_add(lambda b: pc.zoom_mode_set(ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL))
tb.pack(bt, 2, 2, 1, 1)
bt.show()
# show the win
win.show()