Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #17573
| Date | 2011-12-20 12:09 +0100 |
|---|---|
| Subject | Set initial size in TKinter |
| From | Gabor Urban <urbangabo@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3861.1324379384.27778.python-list@python.org> (permalink) |
Hi,
I am quite newbie with Tkinter and I could not find the way to set the
size of the application. (I could find the method to make it
resizeable, though :-)) ) Any ideas, suggestions or links to
references are wellcome.
Here is my code:
from Tkinter import *
class Application(Frame):
def say_hi(self):
self.db += 1
print 'hi there, -->> UG everyone! db = %d'%self.db
## TODO: meretezhetoseg
def createWidgets(self):
top = self.winfo_toplevel()
top.rowconfigure(0,weight = 1)
top.columnconfigure(0,weight = 1)
self.rowconfigure(0,weight = 1)
self.columnconfigure(0,weight = 1)
self.QUIT = Button(self)
self.QUIT["text"] = "QUIT"
self.QUIT["fg"] = "red"
self.QUIT["command"] = self.quit
self.QUIT.pack({"side": "left"})
self.hi_there = Button(self)
self.hi_there["text"] = "Hello",
self.hi_there["command"] = self.say_hi
self.hi_there.pack({"side": "left"})
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
self.db = 0
app = Application()
app.master.title('UG test')
app.mainloop()
Thx in advance...
Gabor
--
Linux is like a wigwam: no Gates, no Windows and an Apache inside.
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Set initial size in TKinter Gabor Urban <urbangabo@gmail.com> - 2011-12-20 12:09 +0100
Re: Set initial size in TKinter Rick Johnson <rantingrickjohnson@gmail.com> - 2011-12-20 06:37 -0800
Re: Set initial size in TKinter Eric Brunel <eric.brunel@pragmadev.nospam.com> - 2011-12-20 16:20 +0100
Re: Set initial size in TKinter Rick Johnson <rantingrickjohnson@gmail.com> - 2011-12-20 07:30 -0800
csiph-web