Reputation: 172
What is the difference between bordermode = OUTSIDE
and bordermode = INSIDE
attribute in place()
method of tkinter in python?
Upvotes: 2
Views: 2466
Reputation: 5680
From the tkinter/__init__.py
file:
bordermode="inside" or "outside" - whether to take border width of
master widget into account
For example:
from tkinter import *
root = Tk()
f1 = Frame(root, borderwidth=5, relief=SUNKEN, width=50, height=50)
f1.pack()
l1 = Label(f1, text="Hi")
l1.place(x=10, y=10, bordermode="outside")
f2 = Frame(root, borderwidth=5, relief=SUNKEN, width=50, height=50)
f2.pack()
l2 = Label(f2, text="Hi")
l2.place(x=10, y=10, bordermode="inside")
root.mainloop()
So, outside
counts x and y from the top left corner of the frame including the border, while inside
counts it without the border.
Upvotes: 4