I want to make my GUI program top frame both vertically and horizontally aligned.
wx.Frame.__init__(self, parent=None, id= -1, title="Test Frame", pos=(-1, -1), size=(1280, 770), style=wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX)
What should I do(except do the calculation to find the absolute position) to pos=(-1, -1)
to make it show in the middle(no matter 800 * 600 or 1280 * 800 etc.), or some other attributes setting also needed?
Simply use
self.Center()
in the class __init__()
instead of pos=(-1,-1)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With