473,327 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

.grid problem is freezing my GUI

360monkey
With some tinkering with previous answers for previous questions, I have come across a new problem with my GUI. I cannot align with the grid (?)

example:
Expand|Select|Wrap|Line Numbers
  1. from Tkinter import *
  2. import random
  3.  
  4. class App:
  5.  
  6.     def __init__(self, master):
  7.         frame = Frame(master)
  8.         frame.pack()
  9.         self.label = LabelFrame(frame, text='Battler III')
  10.         self.label.pack()
  11.         self.areBtn = Button(frame, text='Arena Mode', relief=RAISED, command=self.arena)
  12.         self.areBtn.grid(row=4)
  13.         self.areBtn.pack()
  14.         self.advBtn = Button(frame,text='Adventure Mode', relief=RAISED, command=self.adventure)
  15.         self.advBtn.grid(row=6)
  16.         self.advBtn.pack()
  17.  
  18.     def arena(self):
  19.         top = Toplevel()
  20.         self.label = Label(top, text='Battler III').pack()
  21.         self.pone = Label(top, text='Player One:').grid(row=0)
  22.         self.ptwo = Label(top, text='Player Two:').grid(row=1)
  23.         self.e1 = Entry(top).grid(row=0, column=1)
  24.         self.e2 = Entry(top).grid(row=1, column=1)
  25.  
  26. root = Tk()        
  27. app = App(None)
  28. root.mainloop()
when i run this (in Python 2.6.4), it will freeze my Tk window and not open a toplevel window. I have to exit the console, to restore order.

Help would be appreciated!
>.<
Feb 8 '10 #1
1 2915
bvdet
2,851 Expert Mod 2GB
You cannot mix geometry managers! Mixing pack with grid will create an endless loop.
Feb 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

57
by: Egor Bolonev | last post by:
why functions created with lambda forms cannot contain statements? how to get unnamed function with statements?
3
by: Snake | last post by:
I have a vb .net program which fills a data grid upon form load from an acccess database. This works great. Now, I have to add a combo box and use it to alter the underlying sql statement and...
13
by: Ioannis Vranos | last post by:
Why in this code the form *does not refresh* when it gets the focus/after some time? #using <mscorlib.dll> #using <system.windows.forms.dll> #using <system.dll> #using <system.drawing.dll>
1
by: Ravikanth[MVP] | last post by:
Hi Mike, One suggestion, include datagrid in div with scroll bars. Ravikanth >-----Original Message----- >I have loads of data to scroll through in my datagrid and therefore need
6
by: Steven K | last post by:
Hello, I am having a problem where my computer is freezing when I run a ASP.net project. It freezes in the debugger, or if I try to run it as localhost. I cannot even access the windows...
1
by: boB | last post by:
When I try to run a program - any program - my environment all of a sudden starts freezing up. Even an empty solution. It will build, but never run the built program and the GUI won't respond and...
10
by: MaRCeLO PeReiRA | last post by:
Hi All, After PostgreSQL freeze some times, I am moving from 7.3.4 to 7.4.1, trying to solve this problem. When the daemon get frozen, I can't even use psql to browse a database (as if the...
7
by: bearophileHUGS | last post by:
Most of my ideas seem usless or stupid, but I think expressing them here doesn't harm much. This is an idea for Py 3.0, because it's not backward compatible. Dicts and sets require immutable...
6
by: hem | last post by:
Hi, I have the following small program which read password from user after echoing off. But the problem is, it is freezing for some time (not sure about the duration) before going to the next...
2
by: Pat | last post by:
I'm having some problems with forms freezing up on me. I have a front end linked to tables in 2 back ends. Users can open a form (quotes) which is linked to a table in be1. while adding a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.