Newly-created windows appearing only in the top left corner of the screen

Hi all,
When creating new frames, they always appear at the top left corner of the screen.

Here is the code I am currently working on:

"""Provides the MainFrame class."""

import wx


class MainFrame(wx.Frame):
    """The main client frame.

    This frame does nothing, except provide the means to create and open new worlds.
    """

    def __init__(self) -> None:
        """Create a new frame."""
        super().__init__(None, title="Last MUD")
        p: wx.Panel = wx.Panel(self)
        s: wx.BoxSizer = wx.BoxSizer(wx.VERTICAL)
        s.AddMany(
            [
                wx.StaticText(p, label="&Instructions"),
                wx.TextCtrl(
                    p,
                    style=wx.TE_READONLY | wx.TE_MULTILINE,
                    value="Use the World menu to open or create a new world.",
                ),
            ]
        )
        p.SetSizerAndFit(s)


def main() -> None:
    """Run the program."""
    a: wx.App = wx.App()
    frame: MainFrame = MainFrame()
    frame.Show()
    frame.Maximize()
    a.MainLoop()


if __name__ == "__main__":
    main()

When I run that, the contents of the text field has its lines wrapped, so the text shows up as:

Use the World 
menu to open or 
create a new world.```

The actual line breaks aren't there, but it is wrapping.

Here is (hopefully) a screenshot:

![image|690x387](upload://pdbYrj3ugsicF7unMzdckCxZaDW.png) 

Apologies if this hasn't worked. I am blind, so I've no idea what that shot is of haha.

Thanks in advance for any help.

Oh wait… I didn’t give any arguments in the sizer.AddAll list… My bad. :slight_smile:

Maybe you want to give wxGlade a try for building your GUIs. There are several blind users. I try to keep everything as accessible as possible. Some options can be activated in Edit -> Preferences -> Accessibility.

The download page for the current revision 1.0.1 is here: wxGlade - Browse /wxglade/1.0.1 at SourceForge.net

What is the motivation for lines like these?
p: wx.Panel = wx.Panel(self)

That’s great, thanks. I’ve not used wxGlade before, so very interested to try it out.

That line creates a panel, so that the frame appears the same on all platforms (or so I thought). Is that not right?

I was refering to the type hint / annotation.
I don’t see what value it could add here.

You may want to avoid using SetSizerAndFit as it has some side-effects that are unexpected and confusing. Just use SetSizer instead.

Also, you should probably either pass a size to the TextCtrl constructor or call its SetMinSize method later. The default minimum size is too small in most cases. You’ll probably also want to add that widget to the sizer with proportion=1 and with the wx.EXPAND style, so the widget will grow when the window is resized.

Magic, OK, thank you.