我已經在wx python中指定了尺寸,通過如何禁用wx python小部件的大小調整?
super(BrightnessController, self).__init__(parent, title=title, size=(330, 100))
。
如何完全禁用調整大小?
來源:https://github.com/lordamit/Brightness/blob/master/src/brightness.py
我已經在wx python中指定了尺寸,通過如何禁用wx python小部件的大小調整?
super(BrightnessController, self).__init__(parent, title=title, size=(330, 100))
。
如何完全禁用調整大小?
來源:https://github.com/lordamit/Brightness/blob/master/src/brightness.py
設置的最小和最大尺寸將被調整過去爲他們設定的尺寸停止框架。
import wx
class BrightnessController(wx.Frame):
def __init__(self, parent, title):
super(BrightnessController, self).__init__(parent, title=title,
size=(330, 100))
self.SetMinSize((330, 100))
self.SetMaxSize((330, 100))
self.Show()
if __name__ == '__main__':
app = wx.App()
BrightnessController(None, title='Brightness Controller')
app.MainLoop()
另一種方法是設置樣式爲DEFAULT_DIALOG_STYLE,如果你仍然想也減少MINIMIZE_BOX
import wx
class BrightnessController(wx.Frame):
def __init__(self, parent, title):
super(BrightnessController, self).__init__(parent, title=title,
size=(330, 100), style=wx.DEFAULT_DIALOG_STYLE | wx.MINIMIZE_BOX)
self.Show()
if __name__ == '__main__':
app = wx.App()
BrightnessController(None, title='Brightness Controller')
app.MainLoop()
與嘗試: 超(BrightnessController,個體經營)。 init(parent,title = title,size =(330,100),style = wx.DEFAULT_FRAME_STYLE^wx.RESIZE_BORDER)