|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
grid() fuction
Ok this is weird.. why is it that when i used the pack() fuction my program was working proberly.. but once i changed a few things to .grid() the program does not want to run.. it just halts anyidea why?
Code:
class GUI:
def __init__ (self, master):
frame = Frame (master, bd=1, relief=SUNKEN)
frame.pack (expand=YES, fill=BOTH)
master.title (" Learning Program ")
self.label = Label (frame, text="Message:", fg="blue").grid (row=0, sticky=W)
self.entry = Entry (frame, border=1)
self.entry.grid (row=0, column=1)
self.buttonQuit = Button(frame, text="Quit", background="white",
font="helvetica 7 bold",
pady=1, padx=1, bitmap="error", command=frame.quit)
self.buttonQuit.pack (side=RIGHT, fill=BOTH, expand=YES)
self.button = Button (frame, text="Connect",
background="white",
font="helvetica 7 bold",
pady=1, padx=1, border=2)
self.button.pack (side=RIGHT, fill=BOTH, expand=YES)
self.button.bind("<Button-1>", self.change_color)
__________________
IE QUOTE | PHP Manual | Google | C/C++ Compiler | Linux Tutorials | General Stuff Game Dev |
|
#2
|
||||
|
||||
|
The root of your problem - you can't use pack() and grid() together. So unfortuatly its one or the other although grid() seems to give you more controle over layout in general.
Mak. |
|
#3
|
||||
|
||||
|
Quote:
oh hehe i didnt know that thanx is there anything there.. that i should shange or am i on the right track ![]() |
|
#4
|
||||
|
||||
|
From what i can see its looking fine, just get choose between pack() and grid() - wouldn't quote me on this though, not really a GUI guru and Tkinter makes me sick
![]() Mark. |
|
#5
|
||||
|
||||
|
ya sorry i didnt mean to quote you.. im sick and im tring to learn python at once... for a moment i feel like going to bed but then again i feel like playing around
sux when its like that, btw.. why does Tkinter make you sick? got anything better? your making me feel like if im waisting my time learning Tkinter ![]() |
|
#6
|
||||
|
||||
|
Awwwe, you tuck that totaly the wrong way lord. Sorry your feeling down! Anyway i wouldnt say learning Tk is a waste of time it just looks icky and to be honest seems out of date. So if i had to pick a GUI i'd have to go with wxPython.
dont quote me on that = i might be wrong ![]() Hope this clears things up. Mark. |
|
#7
|
||||
|
||||
|
hehehe i will take a look on wxpython even though i never heard o it.. but i guess now i did hehe but for some stupid reason.. after coding in c/php for a while.. i understand python a bit more heh weird as they are not the same... although if you put 2 and 2 together they are all the same
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > grid() fuction |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|