From 4a0e7fd62e8af79906b606cede07fee1e51d5df1 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 19 Dec 2023 18:57:29 +0300 Subject: [PATCH] Feat(wx): Add `MainWindow.__init__()` [skip ci] --- m_librarian/wx/Application.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/m_librarian/wx/Application.py b/m_librarian/wx/Application.py index adfd03b..a12eb0e 100644 --- a/m_librarian/wx/Application.py +++ b/m_librarian/wx/Application.py @@ -7,6 +7,15 @@ from .session_config import get_session_config class MainWindow(wx.Frame): + def __init__(self): + session_config = get_session_config() + super(wx.Frame, self).__init__( + parent=None, id=-1, title=u"m_Librarian", + ) + self.InitMenu() + self.Show(True) + self.Bind(wx.EVT_SIZE, self.OnSize) + def InitMenu(self): MenuBar = wx.MenuBar() self.SetMenuBar(MenuBar) @@ -22,8 +31,6 @@ class MainWindow(wx.Frame): self.Bind(wx.EVT_MENU, self.OnAbout, about) MenuBar.Append(about_menu, u"&О программе") - self.Bind(wx.EVT_SIZE, self.OnSize) - def OnQuit(self, event): self.Close(True) @@ -51,8 +58,6 @@ class MainWindow(wx.Frame): class Application(wx.App): def OnInit(self): - frame = MainWindow(None, -1, u"m_Librarian") - frame.InitMenu() - frame.Show(True) + frame = MainWindow() self.SetTopWindow(frame) return True -- 2.39.5