#๐Ÿ”’ Grid doesn't work

41 messages ยท Page 1 of 1 (latest)

faint hearth
#

So im one the app Pydroid 3
Mobile

idle coveBOT
#

@faint hearth

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.

faint hearth
#

What ever row/column I want it to bi it just places itselfe in the top left corner

#

@idle cove

undone drum
#

Hmm

#

Even idk that tbh it works if you add others

#

Iirc

#

I usually just use pack so idk

faint hearth
#

Kk thx for trying

obtuse steeple
#

This is because tkinter is smart enough to know that there isn't anything in the other rows/columns so it compacts them. Same thing happens when you run the code on desktop.

faint hearth
#

Thx so what should I do if u know

#

For the Guy in the video it worked

obtuse steeple
faint hearth
#

Kinda

#

I planing to put buttons and input space

obtuse steeple
#

Why not use padding then?

faint hearth
#

Lowkey dont know what is theth

#

I whachd I tut just for this

obtuse steeple
#
from tkinter import *

root = Tk()

my_label = Label(root, text="Hello")
my_label.grid(row=0, column=0, padx=20, pady=20)
my_button = Button(root, text="Click me")
my_button.grid(row=1, column=0, padx=20, pady=20)
input_field = Entry(root)
input_field.grid(row=2, column=0, padx=20, pady=20)

root.mainloop()
faint hearth
#

Yoo u cooked

#

Im finna cry

#

Haha

#

Im gonna ask chatgpt

obtuse steeple
faint hearth
#

Yeah

#

I wont just copy paste

#

I wouldnt understand anything

green dock
#

Are you trying to center this stuff?

#

You need to set the column expander

#

You can set column and row weights, or you can use sticky= for this

obtuse steeple
quick thunder
faint hearth
#

Here is the fix ๐Ÿ™‚

#

Thx for tring

#

To help

#

!close

idle coveBOT
#
Python help channel closed with !close

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.