我正在使用wxpython(2.8)和python2.5。 是否可以强制wx.wx复选框在多个 线? 我希望能做同样的事wx.StaticText.Wrap(宽度)
参见所附示例:thewx.复选框宽200像素,但是 标签不适合此空间。在
非常感谢任何帮助! 谢谢 毛罗
#example starts here
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="Hello World", size=
(300,200))
self.panel = wx.Panel(self, -1)
myVSizer = wx.BoxSizer(wx.VERTICAL)
#instantiating a checkbox 200 px wide. but the label is too
long
cb = wx.CheckBox(self.panel, -1, label="This is a very very
long label for 200 pixel wide cb!", size =wx.Size(200, -1))
myVSizer.Add( cb, 1)
self.panel.SetSizer(myVSizer)
myVSizer.Layout()
app = wx.App(redirect=True)
top = MyFrame()
top.Show()
app.MainLoop()
像这样的怎么样?弯曲! (我把它变成了一个单选按钮,以显示它的行为仍然像一个)
不要使用文本的复选框,而是使用静态文本的无标签复选框来获得所需的效果
这增加了一个好处,即使用不同的布局,您可以使文本居中到复选框,或在左侧或右侧或任何其他位置
将标签更改为
应该这么做。在
也就是说,输入显式的
\n
字符。在在
相关问题 更多 >
编程相关推荐