【发布时间】:2021-05-17 04:49:58
【问题描述】:
我正在尝试从 python 的 Tkinter 创建一个标签,最终将存储信息。现在我只是在使用一个占位符,但是当我用 \n 向下输入文本时,它会在文本中跳动。
当前代码中的标签是什么样子的: Tkinter Label without the text correctly aligned
这是用于制作标签的代码:
StoryFrame = LabelFrame(root, width = 1000, heigh = 300, bg="DarkGrey", highlightbackground='black', text='Current News in Technology', font="Helvetica 15 bold")
StoryFrame.place(relx=0.03, rely= 0.65)
info = Label(StoryFrame, anchor=NW, text="Dateline: Date and/or time\n\nNews source: Name\n\nHostname: Domain\n\nURL: Address", width=40, height=17)
info.place(relx=0.685, rely= 0.01)
【问题讨论】: