我倾向于对python程序中与文本相关的所有内容使用标签。在为大约50个引用编写了一个很长的标签之后,我现在只能使用一个多行标签的顶层窗口,需要一个滚动条,而标签不能滚动。在
我把滚动条放在窗口上,但它不滚动。有没有解决办法来上下滚动我的“文本”标签,或者我需要一个不同的小部件放在我的顶层窗口?在
filewin = Toplevel(background="white")
scrollbar=Scrollbar(filewin)
scrollbar.pack(side=RIGHT, fill=Y)
yscrollcommand=scrollbar.set
Label(filewin, text=". . .\n \
Acidophilium \n\
Wichlacz,P.L., Unz,R.F., Langworthy,T.A. 1986. Acidiphilium angustum sp. nov. Acidiphilium facilis sp. nov. and Acidiphilium vubrum sp. nov. : \n\
Acidophilic Heterotrophic Bacteria Isolated from Acidic Coal Mine Drainage. Int J Syst Bacteriol 36:197-201. \n\
Acinetobacter \n\
Bouvet,P.J.M., Grimont,P.A.D. 1986. Taxonomy of the Genus Acinetobacter with the Recognition of Acinetobacter baumannii sp. nov. Acinetobacter haemolyticus sp. \n\
nov. Acinetobacter johnsonii sp. nov. and Acinetobacter junii sp. nov. and Emended Descriptions of Acinetobacter calcoaceticus and Acinetobacter lwofii. \n\
Int J Syst Bacteriol 36:228-240.",
justify=LEFT, background="white", foreground="black", wraplength=1000).pack()
filewin.title("Matrix References")
不能使用带标签的滚动条。
使用
Text
代替:这会产生(您可能应该调整文本格式):
相关问题 更多 >
编程相关推荐