7 Réponses
+ 5
Melik KOÇYİĞİT I still don't know where the mistake is. I am not very familiar with Tk, so I would only know the answer after looking at the code itself.
Open sololearn.com on your computer:
1. Connect to your account
2. Save the code
3. Share it here
+ 4
We need more info:
1. What GUI framework arr you using ?
2. What are you trying to do ?
3. Where is your code ?
+ 3
Are you using Tk framework?
+ 2
Aymane Boukrouh Thank you 😊 I will add it when I arrive home thanks again for your attention
+ 2
I think columnspan spans across columns+1 that are occupied by other widgets on the top of the widget you are spanning across otherwise tkinter does not allow you to span further.But it could have been helpful if you provided your code.
consider this:
spanning the button across more than 2 columns has no effect or when you move the button to column 3 it stays at column 2
from tkinter import *
root = Tk()
root.geometry('300x300')
l1 = Label(root,bg='pink')
l1.grid(row=0,column=0,padx=10)
l2 = Label(root,bg='pink')
l2.grid(row=0,column=1,padx=10)
l3 = Label(root,bg='pink')
l3.grid(row=1,column=0,padx=10)
l4 = Label(root,bg='pink')
l4.grid(row=1,column=1,padx=10)
l5 = Label(root,bg='pink')
l5.grid(row=2,column=0,padx=10)
l6 = Label(root,bg='pink')
l6.grid(row=2,column=1,padx=10)
b1 = Button(root,text='Click me')
b1.grid(row=3,column=0,columnspan=2)
root.mainloop()
Hope I helped.
+ 1
Aymane Boukrouh I was using Tk framework and making a simple calculator
Sorry My code is on my computer
Now I m on the road just would like to ask is it a common problem or not
0
Sarthak 🇳🇵 Yes