mirror of
https://github.com/python/cpython.git
synced 2025-07-22 10:45:22 +00:00
This demo imported some private code from Matt. Make it cripple along.
This commit is contained in:
parent
6e9dadc1da
commit
60cc90ec98
1 changed files with 10 additions and 3 deletions
|
@ -1,12 +1,19 @@
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
|
##sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
|
||||||
from TkinterUtils import *
|
##from TkinterUtils import *
|
||||||
|
|
||||||
# this shows how to create a new window with a button in it that
|
# this shows how to create a new window with a button in it that
|
||||||
# can create new windows
|
# can create new windows
|
||||||
|
|
||||||
|
class QuitButton(Button):
|
||||||
|
def __init__(self, master, *args, **kwargs):
|
||||||
|
if not kwargs.has_key("text"):
|
||||||
|
kwargs["text"] = "QUIT"
|
||||||
|
if not kwargs.has_key("command"):
|
||||||
|
kwargs["command"] = master.quit
|
||||||
|
apply(Button.__init__, (self, master) + args, kwargs)
|
||||||
|
|
||||||
class Test(Frame):
|
class Test(Frame):
|
||||||
def makeWindow(self, *args):
|
def makeWindow(self, *args):
|
||||||
|
@ -18,7 +25,7 @@ class Test(Frame):
|
||||||
fred.label.create_line("0", "2i", "2i", "0")
|
fred.label.create_line("0", "2i", "2i", "0")
|
||||||
fred.label.pack()
|
fred.label.pack()
|
||||||
|
|
||||||
centerWindow(fred, self.master)
|
##centerWindow(fred, self.master)
|
||||||
|
|
||||||
def createWidgets(self):
|
def createWidgets(self):
|
||||||
self.QUIT = QuitButton(self)
|
self.QUIT = QuitButton(self)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue