本文整理汇总了Python中ij.gui.GenericDialog.enableYesNoCancel方法的典型用法代码示例。如果您正苦于以下问题:Python GenericDialog.enableYesNoCancel方法的具体用法?Python GenericDialog.enableYesNoCancel怎么用?Python GenericDialog.enableYesNoCancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.gui.GenericDialog
的用法示例。
在下文中一共展示了GenericDialog.enableYesNoCancel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _dialog
# 需要导入模块: from ij.gui import GenericDialog [as 别名]
# 或者: from ij.gui.GenericDialog import enableYesNoCancel [as 别名]
def _dialog(self,comment):
gd = GenericDialog(comment)
gd.enableYesNoCancel()
gd.showDialog()
if gd.wasCanceled():
print "user cancelled dialog"
sys.exit(1)
option = gd.wasOKed()
return option
示例2: get_config_file
# 需要导入模块: from ij.gui import GenericDialog [as 别名]
# 或者: from ij.gui.GenericDialog import enableYesNoCancel [as 别名]
def get_config_file(folder):
'''Returns the config file name.'''
# Get list of files in the selected directory.
files = os.listdir(folder)
# Check if a config file is present in folder.
if default_config in files:
dialog = GenericDialog('Default config file found!')
dialog.addMessage('Use this file for the analysis?\n \n%s' % os.path.join(folder, default_config))
dialog.enableYesNoCancel()
dialog.showDialog()
if dialog.wasCanceled():
return None
elif dialog.wasOKed():
return default_config
else:
open_dialog = OpenDialog('Select a config file', folder, default_config)
return open_dialog.getFileName()
else:
# Ask user to select a config file.
open_dialog = OpenDialog('Select a config file', folder, default_config)
return open_dialog.getFileName()