Search code examples
user-interfacewxpythonwxwidgets

wxWidgets dialog doesn't get a maximize box


I've got a wxPython (via wxGlade) app with a dialog that has wx.MAXIMIZE_BOX set in the style, but the maximize box doesn't appear when I run the app.

Here's a minimal program that exhibits the behavior:

#!/usr/bin/env python

import wx

class MyDialog(wx.Dialog):
    def __init__(self, *args, **kwds):
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX
        wx.Dialog.__init__(self, *args, **kwds)
        self.SetTitle("dialog_1")
        self.Layout()

if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    dialog_1 = MyDialog(None, -1, "")
    app.SetTopWindow(dialog_1)
    dialog_1.Show()
    app.MainLoop()

Note that wx.MAXIMIZE_BOX is set, but when I run this program I don't get a maximize box on the dialog:

screenshot -- no maximize box shown

Is this a window manager issue?

Is there something I can do to make the maximize box show up? (My real dialog has a bunch of scrolled text from a log file and it's easier to click maximize than it is to manually resize to fill the screen.)

I'm using:

  • Linux (Ubuntu 10.04 LTS)
  • python-wxgtk, libwxgtk2.8-0, libwxbase2.8-0: 2.8.10.1-0ubuntu1.2
  • metacity: 1:2.30.1-0ubuntu1.1

Solution

  • I found this in the wxWidgets docs:

    "Under Unix or Linux, MWM (the Motif Window Manager) or other window managers recognizing the MHM hints should be running for any of these styles ( including wxMAXIMIZE_BOX ) to have an effect."

    So it sounds like it might well be a window manager issue.