Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7649381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:57:00+00:00 2026-05-31T10:57:00+00:00

The problem I’m seeing with Tkinter (using Python 2.5.1) is that, as I add

  • 0

The problem I’m seeing with Tkinter (using Python 2.5.1) is that, as I add elements using the grid() method, they stack on top of each other instead of making a new row. The code will run, but the widgets are all stacked in two rows in the center of the application. Why is this happening?

from Tkinter import *

import random

class Application(Frame):
    """Define Application's constructor"""
    def __init__(self, master):
        """Initialize the Frame"""
        Frame.__init__(self, master)
        self.grid()
        self.create_widgets()


    #Create the widgets
    def create_widgets(self):
        self.lblTitle = Label(self, text="Build Your Own Burger")
        self.lblTitle.grid(row=0)

        self.lblBurgerImg = Label(self, image=PhotoImage(file="burger.gif"))
        self.lblTitle.grid(row=1)

        self.lblName = Label(self, text="Name:")
        self.lblName.grid(row=2, column=0, columnspan=2, sticky=W)

        self.entryName = Entry(self)
        self.entryName.grid(row=2, column=1, columnspan=2, sticky=W)

        self.lblToppings = Label(self, text = "Toppings:")
        self.lblTitle.grid(row=3, column=0, sticky=W, columnspan=5, sticky=W)

        self.chkCheese = Checkbutton(self, text="cheese")
        self.chkCheese.grid(row=3, column=1, sticky=W, columnspan=5, sticky=W)


#main program

#create a root window
root = Tk()

#assign a title for the GUI
root.title("Order Up!")

#Define size of root window
root.geometry("700x700")

#create an instance of your application
app = Application(root)

#start the event loop
root.mainloop()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:57:02+00:00Added an answer on May 31, 2026 at 10:57 am

    First off, are you certain this code works for you? I get errors about using the sticky option twice on a couple lines. That’s not the problem, however.

    What you think is happening is not what is actually happening. The widgets aren’t “all” stacked on top of each other: two are invisible because you aren’t calling the grid method on them, and it is only the title that is stacked on top of one other widget because that is where you place it.

    The problem is that you call self.lblTitle.grid(...) three times. Two of those three times you were no doubt intending to call the grid method on other widgets.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem: I have a monitor program in Python that uses subprocess' Popen to start
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
Problem: Ajax suggest-search on [ n ] ingredients in recipes. That is: match recipes
Problem: We have a web app that calls some web services asynchronously (from the
Problem: I'm working on a website where there is a dial that displays a
Problem: I have 2 classes, DB class and a User class, that will work
Problem I have a xib file with a UIImageView over the top of the
Problem Description: Multi-player Game that works over the some kind of network, in game
Problem background: I have a Qt/QML Symbian application targeting Qt 4.7.4, that requires a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.