wxpython staticbox 不显示 [英] wxpython staticbox does not display
问题描述
我无法在 Linux Mint 17 平台上的 wx 2.8 下显示静态框.在回到基础并尝试以下代码之前,我为此奋斗了几个小时:
I cannot get a static box to display under wx 2.8 on Linux Mint 17 platform. I fought for hours with this before going back to basics and trying the following code:
#!/usr/bin/python
import wx
class MyDialog(wx.Dialog):
def __init__(self, parent, id, title):
wx.Dialog.__init__(self, parent, id, title, size=(250, 230))
wx.StaticBox(self, -1, 'Personal Info', (5, 5), size=(240, 170))
wx.CheckBox(self, -1 ,'Male', (15, 30))
wx.CheckBox(self, -1 ,'Married', (15, 55))
wx.StaticText(self, -1, 'Age', (15, 95))
wx.SpinCtrl(self, -1, '1', (55, 90), (60, -1), min=1, max=120)
wx.Button(self, 1, 'Ok', (90, 185), (60, -1))
self.Bind(wx.EVT_BUTTON, self.OnClose, id=1)
self.Centre()
self.ShowModal()
self.Destroy()
def OnClose(self, event):
self.Close()
app = wx.App(0)
MyDialog(None, -1, 'staticbox.py')
app.MainLoop()
显示了标签和内容,但没有在屏幕上围绕它们绘制框的提示.有没有人有任何想法,关于:a) 我哪里出错了?或者b) 我的系统中是否存在阻止绘制框的内容?
The label and the contents are displayed but there is no hint of a box drawn around them on the screen. Does anyone have any ideas, as to: a) Where I am going wrong? or b) Is there something about my system that would prevent box drawing?
推荐答案
对于那些发现自己处于类似困境的人来说,答案是在用于桌面的主题中找到.
在控制中心是一个外观设置,如果您使用的是默认 Mint-X 设置,请单击自定义,如果控件设置也是 Mint-X,它不会出于某种原因绘制框.
在控件列表中选择任何其他选项,框就会神奇地出现.我希望这可以防止其他人浪费时间寻找解决方案.
The answer, for those who find themselves in a similar predicament, is to be found in the Theme, being used for the Desktop.
In Control Centre is an Appearance setting and if you are using the Default Mint-X setting, click customise and if the controls setting is also Mint-X, it doesn't draw boxes for some reason.
Choose any other option in the controls list and the boxes magically appear.
I hope this prevents someone else wasting hours looking for the solution.
这篇关于wxpython staticbox 不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!