views:

344

answers:

1

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!

A: 

It seems to be a bug and i think you should file the same. for time being you can user your own dervied dialog class to center it as you wish. Also instead of wx.MessageDialog you can use wx.MessageBox, it will save you few lines.

Anurag Uniyal