#๐Ÿ”’ How do i remove the size of this

142 messages ยท Page 1 of 1 (latest)

boreal sentinelBOT
#

@limber crest

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.

limber crest
#

i want it to be size like this

lapis tusk
#

You need to remove the dimensions specified in your code

limber crest
lapis tusk
#

Share it here pls

limber crest
limber crest
lapis tusk
limber crest
#

oo

#

ok wait

lapis tusk
#

FYI, if its too long use a pastebin

#

!paste

boreal sentinelBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

limber crest
lapis tusk
#

Share the link after you pasted and save it

limber crest
lapis tusk
limber crest
lapis tusk
#

What did you try?

limber crest
#

but it just hide the login button

#

the geometry sht

#

i did 200x150

#

it stays like this

#

i want to move the login button

#

and the register

#

to look like this

limber crest
lapis tusk
#

oh ok

#

That wasn't clear

timid fiber
#

grid them in the same row

#

right now you have row 2 for the login and row 3 for the register

lapis tusk
#

And you gotta change the columnspan so they're in different columns

lapis tusk
#

What did you change?

limber crest
#

i did what he said

#

i did row 2 for register

lapis tusk
#

Did you also change the columnspan?

limber crest
#

how u change the color

lapis tusk
#

I didn't

#

Ah that's just Windows

limber crest
lapis tusk
#

I have this accent color thing

lapis tusk
#

Both of them are on 2

timid fiber
#

and the column

limber crest
#

the login and register size

#

its well fitted the box

timid fiber
#

like this?

limber crest
timid fiber
#

that's going to be a bit trickier than just changing a few values

#

you'll need frames

limber crest
timid fiber
#

like this?

limber crest
#

its well fitted

limber crest
timid fiber
#

It would require a far amount of rewriting then

timid fiber
limber crest
timid fiber
#

actually you could probably cheat it just with setting the button width

limber crest
#

ht i put

#

what

timid fiber
#

create a new frame to add your 2 buttons to

#

and grid that frame to row 2

limber crest
#

i got error

timid fiber
#

What's the error?

limber crest
#

button_frame.grid(row=2, column=0, columnspan=2, sticky="ew")

timid fiber
#

that's not an error

#

that's a line of code

limber crest
#

it says in the terminal

limber crest
timid fiber
#

show the full error

#

that's not the whole error

limber crest
# timid fiber show the full error

PS C:\Users\geral> & C:/Users/geral/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/geral/Downloads/import tkinter as tk.py"
Traceback (most recent call last):
File "c:\Users\geral\Downloads\import tkinter as tk.py", line 61, in <module>
button_frame.grid(row=2, column=0, columnspan=2, sticky="ew")
File "C:\Users\geral\AppData\Local\Programs\Python\Python312\Lib\tkinter_init_.py", line 2569, in grid_configure
self.tk.call(
_tkinter.TclError: cannot use geometry manager grid inside . which already has slaves managed by pack
PS C:\Users\geral>

timid fiber
#
_tkinter.TclError: cannot use geometry manager grid inside . which already has slaves managed by pack
PS C:\Users\geral>
#

That's the error

#

you cannot use pack and grid in the same frame

#

can you show your code?

limber crest
#

!paste

boreal sentinelBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

limber crest
timid fiber
#

do you understand what a frame is?

limber crest
#

im no coder

#

thats why i ask help here

#

but thanks tho

timid fiber
#

yes, but just be aware these help threads are not for you to fix your code for you

#

we're here to help you learn so you can fix it yourself

timid fiber
#

a Frame is basically a container that can hold other widgets

#

do you know what a widget is?

limber crest
#

the other like box isnt it

#

?

timid fiber
#

a widget is any UI element, like a button, or an entry

limber crest
#

thanks

#

may ik what is ur course?

#

in college

timid fiber
#

a frame itself is also a widget, but it's more of an organizational thing

timid fiber
limber crest
#

cause im grade 10 im planning to take coding

timid fiber
#

ok so tkinter uses 2 types of "geometry manager"

#

this determines how widgets are added into a frame

#

we can "pack" or we can "grid"

#

pack simply places one object next to the previous one based on the order you pack them

limber crest
#

sorry i use translate

#

and grid is for

timid fiber
#

do you know what a grid is (in non python terms)?

limber crest
#

?

timid fiber
#

yes exactly

#

so we can arrange things in a grid formation by choosing row and column

limber crest
#

how about the columnspan

#

what does it do

timid fiber
#

that determines how many columns your widget takes up

#

by default, they only take up 1 row, and 1 column

limber crest
#

i am going to figure things now

timid fiber
#

ok, now tkinter does not allow us to use grid and pack together in the same frame

#

if we have a frame, and we grid something into that frame, then we can't also pack something into that frame

#

but each frame can use its own manager, so we can pack a frame into the window, and then grid things into that frame

#

it might sound a bit confusing

#

but each frame is basically its own little organizational element

limber crest
#

in my notepad

#

just incase i read it again

#

tyy

boreal sentinelBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.