#๐Ÿ”’ How to make the red part half of the screen

22 messages ยท Page 1 of 1 (latest)

sour marsh
#

import tkinter as tk

myApp = tk.Tk()
myApp.title("Pizza Shop")
myApp.geometry("1000x800")
myApp.configure(background="gray")

top_frame = tk.Frame(myApp, bg="red", height=500)
top_frame.pack(fill="x", side="top")

bottom_frame = tk.Frame(myApp, bg="green")
bottom_frame.pack(fill="both", expand=True)

tk.Label(top_frame, bg="red", fg="white").grid(row=0, column=0, pady=10)
tk.Label(bottom_frame, bg="green", fg="white").grid(row=0, column=0, pady=10)

Most of the screen is show green tho and saying pady not defined

celest pivotBOT
#

@sour marsh

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

left coral
#

-# AI

tacit ridge
#

There's padding

#

not pady

sour marsh
tacit ridge
#

I didn't see that you were using grid

#

So there is pady in grid

tacit ridge
mighty gazelle
#

You have specified both labels as 0, 0 on the grid

#

which is probably leading to this default behavior

sour marsh
# tacit ridge

It shows the same for me but then says pady not defined

tacit ridge
sour marsh
tacit ridge
sour marsh
celest pivotBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.