0

What method / methods should be be used in order to get the frame to start up in a central position of the screen, and could you also provide the code please. I'm using wxPython. thanks

Edited by baki100: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by baki100
0

Here you go ...

# a wxPython general frame template

import wx

class MyFrame(wx.Frame):
    def __init__(self, parent, mytitle, mysize):
        wx.Frame.__init__(self, parent, wx.ID_ANY, mytitle, size=mysize)
        self.SetBackgroundColour("red")

        # create an input widget
        #
        # bind mouse or key event to an action
        #
        # create an output widget
        #

    def onAction(self, event):
        """ some action code"""
        pass


app = wx.App(0)
# create a MyFrame instance and show the frame
mytitle = 'the title'
width = 400
height = 300
frame = MyFrame(None, mytitle, (width, height))
# his will center the frame in the display area
frame.Center()
frame.Show()
app.MainLoop()
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.