G
Gabor Urban
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
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