当前位置: 首页>>代码示例>>Python>>正文


Python tkMessageBox.askyesnocancel方法代码示例

本文整理汇总了Python中tkMessageBox.askyesnocancel方法的典型用法代码示例。如果您正苦于以下问题:Python tkMessageBox.askyesnocancel方法的具体用法?Python tkMessageBox.askyesnocancel怎么用?Python tkMessageBox.askyesnocancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tkMessageBox的用法示例。


在下文中一共展示了tkMessageBox.askyesnocancel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: maybesave

# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import askyesnocancel [as 别名]
def maybesave(self):
        if self.get_saved():
            return "yes"
        message = "Do you want to save %s before closing?" % (
            self.filename or "this untitled document")
        confirm = tkMessageBox.askyesnocancel(
                  title="Save On Close",
                  message=message,
                  default=tkMessageBox.YES,
                  master=self.text)
        if confirm:
            reply = "yes"
            self.save(None)
            if not self.get_saved():
                reply = "cancel"
        elif confirm is None:
            reply = "cancel"
        else:
            reply = "no"
        self.text.focus_set()
        return reply 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:23,代码来源:IOBinding.py

示例2: maybesave

# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import askyesnocancel [as 别名]
def maybesave(self):
        if self.get_saved():
            return "yes"
        message = "Do you want to save %s before closing?" % (
            self.filename or "this untitled document")
        confirm = tkMessageBox.askyesnocancel(
                  title="Save On Close",
                  message=message,
                  default=tkMessageBox.YES,
                  parent=self.text)
        if confirm:
            reply = "yes"
            self.save(None)
            if not self.get_saved():
                reply = "cancel"
        elif confirm is None:
            reply = "cancel"
        else:
            reply = "no"
        self.text.focus_set()
        return reply 
开发者ID:nccgroup,项目名称:Splunking-Crime,代码行数:23,代码来源:IOBinding.py

示例3: quit

# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import askyesnocancel [as 别名]
def quit(self):
        if self.settings_dirty.get() or self.project_dirty.get():
            savechanges = tkMessageBox.askyesnocancel("Save changes", "You have unsaved project changes. Do you want to save them before quitting?")
            if savechanges is None:
                return
            elif savechanges:
                self.noask_save_project()
            self.master.destroy()
        else:
            # write gui settings and destroy
            self.write_gconfig()
            self.master.destroy()


    ####################### PROJECT FUNCTIONS ################################# 
开发者ID:danielnyga,项目名称:pracmln,代码行数:17,代码来源:mlnlearn.py

示例4: check_save

# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import askyesnocancel [as 别名]
def check_save(self):
        if not self.edited:
            return True # No changes, all good
        # Post a dialog asking if we want to save the current plist
        answer = mb.askyesnocancel("Unsaved Changes", "Save changes to {}?".format(self.get_title()))
        if answer == True:
            return self.save_plist()
        return answer 
开发者ID:corpnewt,项目名称:ProperTree,代码行数:10,代码来源:plistwindow.py


注:本文中的tkMessageBox.askyesnocancel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。