Customized dialog : Dialog « GUI Tk « Python

Python
1. 2D
2. Application
3. Buildin Function
4. Class
5. Data Structure
6. Data Type
7. Development
8. Dictionary
9. Event
10. Exception
11. File
12. Function
13. GUI Pmw
14. GUI Tk
15. Language Basics
16. List
17. Math
18. Network
19. String
20. System
21. Thread
22. Tuple
23. Utility
24. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Python » GUI Tk » DialogScreenshots 
Customized dialog
Customized dialog


from Tkinter import *
from tkMessageBox import askyesno, showerror

class NewDialogDemo(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

    def greet(self):
        print "hi"

    def createWidgets(self):
        Label(self,  text='Label').pack(side=TOP)
        Button(self, text='Button 1', command=self.dialog1).pack()
        Button(self, text='Button 2', command=self.dialog2).pack()
        Button(self, text='Button 3',  command=self.greet  ).pack(side=LEFT)
        Button(self, text='Button 4',  command=self.quit   ).pack(side=RIGHT)

    def dialog1(self):
        ans = askyesno('Title!', 'Text')
        if ans: self.dialog2()

    def dialog2(self):
        showerror('Error title', "Text")

if __name__ == '__main__': NewDialogDemo().mainloop()

           
       
Related examples in the same category
1. A message boxA message box
2. showwarning Dialog boxshowwarning Dialog box
3. Use message to alert an ExceptionUse message to alert an Exception
4. OK cancel dialog boxOK cancel dialog box
5. Creating a simple dialogCreating a simple dialog
6. Add components to a dialogAdd components to a dialog
7. Get input value from a dialogGet input value from a dialog
8. A dialog support classA dialog support class
9. A simple dialog: with two labels and two text fieldsA simple dialog: with two labels and two text fields
10. Add a check box to a DialogAdd a check box to a Dialog
11. Pop up dialog: build a dialogPop up dialog: build a dialog
12. Dialog RecursiveDialog Recursive
w__ww__.j___a_v_a___2__s__.__co___m__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.