本文整理汇总了Python中pyface.api.FileDialog.title方法的典型用法代码示例。如果您正苦于以下问题:Python FileDialog.title方法的具体用法?Python FileDialog.title怎么用?Python FileDialog.title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyface.api.FileDialog
的用法示例。
在下文中一共展示了FileDialog.title方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ask_user_for_loadfile
# 需要导入模块: from pyface.api import FileDialog [as 别名]
# 或者: from pyface.api.FileDialog import title [as 别名]
def ask_user_for_loadfile(title=None):
from pyface.api import FileDialog, OK
dialog = FileDialog(action='open')
if title is not None:
dialog.title = title
dialog.open()
if dialog.return_code != OK:
return
return os.path.join( dialog.directory, dialog.filename )
示例2: ask_user_for_savefile
# 需要导入模块: from pyface.api import FileDialog [as 别名]
# 或者: from pyface.api.FileDialog import title [as 别名]
def ask_user_for_savefile(title=None):
#from traitsui.file_dialog import save_file
from pyface.api import FileDialog, OK
dialog = FileDialog(action='save as')
if title is not None:
dialog.title = title
dialog.open()
if dialog.return_code != OK:
return
return os.path.join( dialog.directory, dialog.filename )
示例3: perform
# 需要导入模块: from pyface.api import FileDialog [as 别名]
# 或者: from pyface.api.FileDialog import title [as 别名]
def perform(self, event):
app = event.task.window.application
service = app.get_service(IFileHandlingService)
directory = service.get_recent_directory()
dialog = FileDialog(
wildcard=self._wildcard_string(), default_directory=directory)
dialog.title = 'Load Table to UI Builder'
if dialog.open() == OK:
service.push_recent_file(dialog.path)
opts = self._get_model()
opts.path = dialog.path
opts.application = app
application_manager.create_app()
view = self._get_enaml_view()
view.options = opts
view.show()