[tkinter] how to make a grid with no borders?

Post here if you need help with creating a Graphical User Interface in Python.

[tkinter] how to make a grid with no borders?

Postby eslavko » Thu Dec 26, 2013 10:26 am

Hello...
How to get more canvas packed as grid without borders?
here is stripped example. the board should be all red but I got just grid of red squares.

Code: Select all
import Tkinter
lader = Tkinter.Tk()
laderGrid=[]
for r in range(10):
    laderGrid.append([])
    for c in range(10):
        laderGrid[r].append([])
        laderGrid[r][c]=Tkinter.Canvas(lader,bg="red", height=30, width=30)       
        laderGrid[r][c].grid(row=r,column=c,padx=0,ipadx=0)
lader.mainloop()
Last edited by Yoriz on Thu Dec 26, 2013 12:02 pm, edited 2 times in total.
Reason: first post lock, changed title.
eslavko
 
Posts: 25
Joined: Thu Dec 26, 2013 10:23 am

Re: [tkinter] how to make a grid with no borders?

Postby Mekire » Thu Dec 26, 2013 2:31 pm

Apparently this is a result of highlight thickness:
Code: Select all
import Tkinter
lader = Tkinter.Tk()
laderGrid=[]
for r in range(10):
    laderGrid.append([])
    for c in range(10):
        laderGrid[r].append([])
        laderGrid[r][c]=Tkinter.Canvas(lader,bg="red", height=30, width=30,highlightthickness=0)
        laderGrid[r][c].grid(row=r,column=c,padx=0,ipadx=0)
lader.mainloop()

-Mek
User avatar
Mekire
 
Posts: 1124
Joined: Thu Feb 07, 2013 11:33 pm
Location: Asakusa, Japan

Re: [tkinter] how to make a grid with no borders?

Postby eslavko » Thu Dec 26, 2013 4:00 pm

Thanks...

perfect
eslavko
 
Posts: 25
Joined: Thu Dec 26, 2013 10:23 am


Return to GUI

Who is online

Users browsing this forum: No registered users and 3 guests