2014-01-25 49 views

回答

1

設置的最小和最大尺寸將被調整過去爲他們設定的尺寸停止框架。

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() 
1

與嘗試: 超(BrightnessController,個體經營)。 init(parent,title = title,size =(330,100),style = wx.DEFAULT_FRAME_STYLE^wx.RESIZE_BORDER)

相關問題