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.