views:

27

answers:

1

I am creating a wx.Frame that cannot be resized.
How do I disable the size grip at the right side of a status bar?

Quoting 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.

Translating to wxPython, it should read wx.ST_SIZEGRIP. Here is my code:

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

Unfortunately, the size grip is still there. Any ideas on how to make it disappear?

+1  A: 

Instead of setting style later, set it at creation time e.g.

statusBar = self.CreateStatusBar(style=0)

You may try other styles for statusbar if they exist.

Anurag Uniyal
Thanks! Looking good now :)
Kit