diff --git a/youtube_dl_gui/mainframe.py b/youtube_dl_gui/mainframe.py index 5a44244..7dc3994 100644 --- a/youtube_dl_gui/mainframe.py +++ b/youtube_dl_gui/mainframe.py @@ -85,6 +85,9 @@ class MainFrame(wx.Frame): self.app_icon = wx.Icon(self.app_icon, wx.BITMAP_TYPE_PNG) self.SetIcon(self.app_icon) + # Create options frame + self._options_frame = OptionsFrame(self) + # Create components self._panel = wx.Panel(self) @@ -309,8 +312,7 @@ class MainFrame(wx.Frame): def _on_options(self, event): ''' Event handler method for self._options_btn. ''' - options_frame = OptionsFrame(self) - options_frame.Show() + self._options_frame.Show() def _on_close(self, event): ''' Event handler method (wx.EVT_CLOSE). ''' diff --git a/youtube_dl_gui/optionsframe.py b/youtube_dl_gui/optionsframe.py index 1a55b4c..c05d49d 100644 --- a/youtube_dl_gui/optionsframe.py +++ b/youtube_dl_gui/optionsframe.py @@ -172,7 +172,7 @@ class OptionsFrame(wx.Frame): def _on_close(self, event): ''' Event handler for wx.EVT_CLOSE. ''' self.save_all_options() - self.Destroy() + self.Hide() def reset(self): ''' Reset default options. '''