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

  • SEARCH
  • Home
  • 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 7739725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:35:37+00:00 2026-06-01T08:35:37+00:00

I am experimenting with Tkinter, as I was trying to figure out is there

  • 0

I am experimenting with Tkinter, as I was trying to figure out is there a way to set the tkinter’s window size without using canvas. I came upon this how to set frame size question on SO’s Question & Answer. So I went ahead and test it by writing a very small program to display a text label. But I found out it is “missing”, or disappear when I use frame.pack_propagate(0)

import tkinter as tk

root = tk.Tk()
frame = tk.Frame(root, width=400, height=400)
# Does not work at the moment, textBox is missing
# frame.pack_propagate(0) 
frame.pack()

textBox = tk.Label(frame, text="(x,y): ")
textBox.pack()

root.mainloop()

So my question is, can you explain why my textBox (Label) is not appearing when I use the frame.pack_propagate(0) instead of frame.pack() method? And secondly, is there a way to set the window size without using a canvas? I want to know because I am writing a series of small programs to teach my friend about tkinter, before introducing canvas to him. It would be nice if the window size are all the same across my tkinter samples. And I am just wondering as well (curious). Thank you very much.

I am using python 3.2.2 on MAC OS 10.5.8.

  • 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-06-01T08:35:38+00:00Added an answer on June 1, 2026 at 8:35 am

    pack_propagate only sets a flag, it doesn’t cause the frame to be placed in the widget. It is not a substitute for calling pack.

    In other words you must do this:

    # put the frame in its parent
    frame.pack()
    
    # tell frame not to let its children control its size
    frame.pack_propagate(0)
    
    # put the textbox in the frame
    textBox.pack()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experimenting with the Play 2.0 framework on Scala. I'm trying to figure out
I experimenting with WebView in Android and I can't figure out how to make
I've been experimenting with Tkinter, and I have a set-up where I have an
I am experimenting with Tkinter for the first time, and am trying to call
After experimenting with composite operations and annotation pdf on the canvas I'm now trying
After experimenting with composite operations and drawing images on the canvas I'm now trying
I experimenting with jQuery. As I was trying I found out that I can't
Experimenting with Scala... I'm trying to define something analogous to the @ hack in
Experimenting with android game development. I'm using PNG format for images, and was wondering
I am currently experimenting with various input controls and have stumbled upon SneakyInput, which

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.