我正在尝试在我的应用程序末尾创建一个帮助菜单。我也使用了Message
小部件。我的窗口基本上是一个有两列的网格。我已经将消息小部件放在了末尾,并跨越了两列,但是由于某种原因,小部件并没有占据整个水平空间。有没有办法强迫它占据所有的水平空间(同时确保文本换行显示在下面)
程序代码:
self.helpDesc = """Help:
1. The URL textbox specified the URL to be watched. In order to verify whether the given URL is valid according to the program one could wait for the status code of the URL to appear in the next line.
2. Testing Again
"""
self.helpBox = Message(self, text=self.helpDesc, anchor='w')
self.helpBox.grid(row=10, column=0, columnspan=2, sticky=N+S+W+E, padx=8, pady=8)
输出:
您需要为messagebox设置一个
width
参数。这些通常使用像素值,而标签使用预期的字符数。如果需要的话,我相信有一种方法可以改变这些,但我不记得那是什么。不管怎样,这都会让你更接近你的目标相关问题 更多 >
编程相关推荐