Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

stuff inside frame in .grid() method doesn't seem to wanna work

trying to use the .grid method to make a school assignment and stuff i try to have under a frame seems to ignore the frame’s position, is there a way to have it stay inside the frame? or in summary can stuff be put inside frames and be placed alongside the frame?

used code:

from tkinter import *
import random as rn

hlavni=Tk()
hlavni.geometry('500x400')
hrac_f=Frame(hlavni,width=100,height=100,bg="red")
hrac_f.grid(row=0,column=1,padx=20,pady=20)
test1=Label(hrac_f,text="why").grid(row=0,column=0,padx=20,pady=20)
hlavni.mainloop()

picture of what i am getting
current wrong result

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

i tried looking through forums and tried using tutorial vids but none had the information i was looking for.

what i am trying to achieve rn:
current next goal

final goal of the assignment(if there exists a better solution the one i am trying to use):
the assignment

>Solution :

This what is my bot had said :)) lol

from tkinter import *
import random as rn
#This is fucking BUG
hlavni=Tk()
hlavni.geometry('500x400')
hrac_f=Frame(hlavni,width=100,height=100,bg="red")
hrac_f.grid(row=0,column=1,padx=20,pady=20)
test1=Label(hrac_f,text="why").grid(row=0,column=0,padx=20,pady=20)
hlavni.mainloop()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading