Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60cc90e

Browse files
committed
This demo imported some private code from Matt. Make it cripple along.
1 parent 6e9dadc commit 60cc90e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Demo/tkinter/matt/window-creation-w-location.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
from Tkinter import *
22

33
import sys
4-
sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
5-
from TkinterUtils import *
4+
##sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
5+
##from TkinterUtils import *
66

77
# this shows how to create a new window with a button in it that
88
# can create new windows
99

10+
class QuitButton(Button):
11+
def __init__(self, master, *args, **kwargs):
12+
if not kwargs.has_key("text"):
13+
kwargs["text"] = "QUIT"
14+
if not kwargs.has_key("command"):
15+
kwargs["command"] = master.quit
16+
apply(Button.__init__, (self, master) + args, kwargs)
1017

1118
class Test(Frame):
1219
def makeWindow(self, *args):
@@ -18,7 +25,7 @@ def makeWindow(self, *args):
1825
fred.label.create_line("0", "2i", "2i", "0")
1926
fred.label.pack()
2027

21-
centerWindow(fred, self.master)
28+
##centerWindow(fred, self.master)
2229

2330
def createWidgets(self):
2431
self.QUIT = QuitButton(self)

0 commit comments

Comments
 (0)