wx.CreateStatusBar()没有调整大小的手

2024-09-24 02:20:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在创建一个无法调整大小的wx.Frame
如何禁用状态栏右侧的尺寸夹点?在

引用http://docs.wxwidgets.org/2.6/wx_wxstatusbar.html#wxstatusbar

Window styles
wxST_SIZEGRIP -- On Windows 95, displays a gripper at right-hand side of the status bar.

转换为wxPython时,它应该是wx.ST_SIZEGRIP。这是我的代码:

import wx

class Frame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent=parent, id=wx.ID_ANY, title=title,
                          style=wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX),
                          pos=(20, 20))
        self.createStatusBar()
        self.Show()

    def createStatusBar(self):
        statusBar = self.CreateStatusBar()
        statusBar.SetWindowStyle(statusBar.GetWindowStyle() ^ wx.ST_SIZEGRIP)

if __name__ == '__main__':
    app = wx.PySimpleApp(False)
    frame = Frame(parent=None, title="Any title")
    app.MainLoop()

不幸的是,尺寸控制仍然存在。有什么办法让它消失吗?在


Tags: selfapptitleinit尺寸defframeparent