tk scaling in python problem, HELP!

Fredrik Lundh effbot at telia.com
Fri Oct 20 16:15:41 EDT 2000


vogler at innercite.com wrote:
> How do I call it within python? I tried the following command without
> any success:
>
>      self.master.tk.call( 'tk', 'scaling', '1.0' )
>
> It appears that python passed it on to tcl/tk, but the scaling does not
> change. I didn't get any error messages and python went on its merry
> way.

this works for me (using 8.2).  on a 96-dpi screen,
the red box comes out smaller than the blue one:

from Tkinter import *

root = Tk()

print "original", root.tk.call("tk", "scaling")
Frame(root, bg="red", width="1c", height="1c").pack()

root.tk.call("tk", "scaling", "1.0")
print "new", root.tk.call("tk", "scaling")

Frame(root, bg="blue", width="1c", height="1c").pack()

mainloop()

</F>





More information about the Python-list mailing list