How do you position a wx.MessageDialog (wxPython)?

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2010-03-10T18:48:15Z Indexed on 2010/03/13 5:35 UTC
Read the original article Hit count: 225

Filed under:
|
|
|

Hi:

Is there any reason why the position, pos, flag doesn't seem to work in the following example?

dlg = wx.MessageDialog(
    parent=self,
    message='You must enter a URL',
    caption='Error',
    style=wx.OK | wx.ICON_ERROR | wx.STAY_ON_TOP,
    pos=(200,200)
)

dlg.ShowModal()
dlg.Destroy()

The documentation is here: http://www.wxpython.org/docs/api/wx.MessageDialog-class.html

'self' is a reference to the frame. I'm running in Windows Vista, python26, wxpython28. The message dialog always appears to be in the middle of the screen.

If for some reason it's not possible to position the dialog, is there anyway to at least restrict the dialog to be in the frame, rather than just the center of the screen?

thanks!

© Stack Overflow or respective owner

Related posts about wxpython

Related posts about python