【发布时间】:2015-09-30 22:34:18
【问题描述】:
我正在尝试放置我的标签,以便它们与框架的左侧对齐。但是,它们显示在中心,如下所示。我必须在配置中放置什么才能正确对齐它们?
这是我处理此问题的代码部分:
this.topFrame = Frame(this.chatWindow,relief="sunken",bd=1)
this.midFrame = Frame(this.chatWindow,relief="sunken",bd=1)
this.topFrame.pack(fill="x",expand = True)
this.midFrame.pack(fill="x",expand = True)
向热门用户框架添加海报
for poster in topPosters:
label = Label(this.topFrame,text=poster)
label.config(anchor=W,justify=LEFT)
label.pack()
将消息添加到消息框架
for message in messageList:
label = Label(this.midFrame,text=message)
label.config(anchor=W,justify=LEFT)
label.pack()
【问题讨论】:
标签: python user-interface tkinter label frame