我正在开发一个 wxPython GUI 应用程序,我需要在其中创建一个大字符串的按钮标签 - 例如“更改地址”
问题是按钮标签没有被包裹并且按钮大小扩大,这不是本意。
有什么方法可以将按钮标签包裹在指定大小的按钮周围?
You shouldn't make buttons with long labels to begin with. Buttons are not supposed to have long labels. Use a TextCtrl or a StaticText instead.
However, if you really, really want to do this, try inserting line breaks into your strings. In Python, you would do this:
label= "Change the\n Address"
This works on Windows anyway with wxPython 2.9