Tkinter / Aqua (OS X) question (canvas borders)

D

dmsbox2000-list1

This is a beginner question. I am using a Mac running OS X. I have
TclTkAqua installed. If I type:

import Tkinter

r = Tkinter.Tk()
c = Tkinter.Canvas(r)
c.pack()
c.create_line(0,0,100,0)

the line is not visible. If I type:

c.create_line(3,4,100,4)

the line is visiable. There appears to be an asymmetric "border"
around the inside of the canvas. If I type

print c.cget('padx'), c.cget('pady')

I get zero. How do I find out the size of the border? Is this
specific to the Aqua version of Tk?

I have X Windows installed. Would I be better off if I down loaded the
Unix version of Tk and Tkinter/python and compiled it for X?
 
D

Dave Opstad

There appears to be an asymmetric "border"
around the inside of the canvas.

There was a thread on this last May (you can search for the thread
titled "Unusable outer edge of Tkinter canvases?")

Fredrik Lundh suggested resetting the coordinate system via:

w.xview_moveto(0)
w.yview_moveto(0)

This seemed to help, but in the end it still seems that there's a narrow
border inside the edges of a Canvas which can't be drawn to. And it
seems to be different for OS X and Windows.

In the end I just made sure everything I draw is no closer than 5 pixels
from the edge of the Canvas, and that seems to work on all the platforms
I'm deploying on.

Dave Opstad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top