當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。