from tkinter import *from tkinter import simpledialogimport sys, osclass SettingDialog(simpledialog.Dialog):def body(self, master):Label(master, text="First").grid(row=0, sticky=W)root = Tk()#Without "default" keyword, only root (parent) window icon is changed#other child dialogs still use Tk iconroot.iconbitmap(default='AC.ico')#call withdraw() to remove parent window, only show the child dialog.root.withdraw()SettingDialog(root, "hello")
Showing posts with label dialog. Show all posts
Showing posts with label dialog. Show all posts
Thursday, August 26, 2010
Create a simple dialog in Tkinter (python)
To create a dialog in Python using Tkinter module, just inherit from simpledialog.Dialog class from tkinter.simpledialog module (Python 3).
Subscribe to:
Posts (Atom)