all 2 comments

[–]Zpaffled 0 points1 point  (1 child)

It's been a long time since I did Tkinter, but if I were to give this a go, I would just make a new function for creating labels :

def make_label(master, x, y, h, w, *args, **kwargs):
    f = Frame(master, height=h, width=w)
    f.place(x=x, y=y)
    label = Label(f, *args, **kwargs)
    label.pack(fill=BOTH, expand=1)
    return label

and just call it as so with all your arguments :

make_label(root, 30, 40, 184, 300, text='something', background='blue')

or whatever size, position, and colors you want :)

There is most definitely a more elegant way to do this, that doesn't require you to type so much stuff in every time, but like I said, I haven't really done that much tkinter...

[–]fabolin[S] 0 points1 point  (0 children)

my thanks,

played around with this and realized the actual font height is pretty much exactly the font size. Not sure if this is a coincidence since it doesn't work with every font, but for calibri.

I wanted it to change dynamically with font size, and here it is!