Skip to content

Commit e815fbe

Browse files
committed
Fix WxApp not being initialised correctly (#2)
1 parent c698cf0 commit e815fbe

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/gui/systray.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
from typing import Any, Callable, Optional
33

44
import wx
5+
import wx.adv
56

67
from common import local_path
78

8-
from .wx_app import WxApp
9-
109
log = logging.getLogger(__name__)
1110

1211
MenuItem = tuple[str, Callable | 'MenuList', Optional[bool]]
@@ -43,7 +42,6 @@ def exit(self):
4342
if callable(self._on_exit):
4443
self._on_exit()
4544
self.RemoveIcon()
46-
WxApp().ExitMainLoop()
4745

4846
def __enter__(self):
4947
return self

src/gui/wx_app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def __init__(self):
2222
super().__init__()
2323

2424
def __new__(cls, *args, **kwargs):
25-
if not isinstance(getattr(cls, '__instance', None), cls):
26-
cls.__instance = wx.App.__new__(cls, *args, **kwargs)
27-
return cls.__instance
25+
if not isinstance(getattr(cls, '_WxApp__instance', None), cls):
26+
cls._WxApp__instance = wx.App.__new__(cls, *args, **kwargs)
27+
return cls._WxApp__instance
2828

2929
def OnInit(self):
3030
if isinstance(getattr(self, '_top_frame', None), wx.Frame):

0 commit comments

Comments
 (0)