Search code examples
pythonwxwidgets

How do I center a wx.MessageDialog to the frame?


I've tried setting dlg.CenterOnParent() but that doesn't work. I assume it's because my MessageDialog is not setting the frame as the parent. In that case how would I do this?


Solution

  • When you create a wx widget, the normal pattern of the create function is wx.SomeUIObject(parent, id, ...). The parent could be set when you create the dialog.