I am writing an application with tkinter and I am trying to put a few labels in a frame ... Unfortunately
windowTitle=Label(... width=100)
and
windowFrame=Frame(... width=100)
- very different widths ...
So far I am using this code:
windowFrame=Frame(root,borderwidth=3,relief=SOLID,width=xres/2,height=yres/2) windowFrame.place(x=xres/2-160,y=yres/2-80) windowTitle=Label(windowFrame,background="#ffa0a0",text=title) windowTitle.place(x=0,y=0) windowContent=Label(windowFrame,text=content,justify="left") windowContent.place(x=8,y=32) ...
For some reason, setting the label width does not set the width correctly or does not use pixels as units ... So, is there a way to place the windowTitle widget so that it adapts to the frame length or set the label width in pixels?
source share