X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_librarian%2Fwx%2FAWindow.py;h=68f673b5077dbc27eae24aecd7a821de6264830b;hb=b4e8312234ce185b904e9f44427c4e5971cb78c9;hp=4621fd49a43c506bbedad2a1c9c4245a2f02a1ba;hpb=9e210d511eb1c71e8f109332e49dd61c84c90c55;p=m_librarian.git diff --git a/m_librarian/wx/AWindow.py b/m_librarian/wx/AWindow.py index 4621fd4..68f673b 100644 --- a/m_librarian/wx/AWindow.py +++ b/m_librarian/wx/AWindow.py @@ -45,8 +45,14 @@ class AWindow(wx.Frame): self.SetMenuBar(MenuBar) file_menu = wx.Menu() - exit = file_menu.Append(wx.ID_EXIT, u"&Выход", u"Выйти из программы") - self.Bind(wx.EVT_MENU, self.OnQuit, exit) + + if self.Parent: + close_win = \ + file_menu.Append(wx.ID_CLOSE, u"&Закрыть", u"Закрыть окно") + self.Bind(wx.EVT_MENU, self.OnCloseCommand, close_win) + + quit = file_menu.Append(wx.ID_EXIT, u"&Выход", u"Выйти из программы") + self.Bind(wx.EVT_MENU, self.OnQuit, quit) MenuBar.Append(file_menu, u"&Файл") about_menu = wx.Menu() @@ -55,9 +61,12 @@ class AWindow(wx.Frame): self.Bind(wx.EVT_MENU, self.OnAbout, about) MenuBar.Append(about_menu, u"&О программе") - def OnQuit(self, event): + def OnCloseCommand(self, event): self.Close(True) + def OnQuit(self, event): + wx.GetApp().ExitMainLoop() + def OnAbout(self, event): aboutInfo = wx.adv.AboutDialogInfo() aboutInfo.SetName(u'm_Librarian')