I have an application from which I would like to launch a modeless
dialog. However, I would like to have only one instance of such a
dialog opened. Even if Singleton design pattern has been criticized for
a while it seems to me that it is relevant in such case.
I implemented this in the little script enclosed. The first time I
launch my dialog, it pops up but the second time I launch it I get the
following error:
I have an application from which I would like to launch a
modeless
dialog. However, I would like to have only one instance of
such a
dialog opened. Even if Singleton design pattern has been
criticized for
a while it seems to me that it is relevant in such case.
I implemented this in the little script enclosed. The first
time I
launch my dialog, it pops up but the second time I launch it I
get the
following error:
You're getting a call to __new__ and a call to __init__ each time.
The second call to init fails, because the wx.Frame has already
been initialized. I made this modification:
I have an application from which I would like to launch a
modeless
dialog. However, I would like to have only one instance of
such a
dialog opened. Even if Singleton design pattern has been
criticized for
a while it seems to me that it is relevant in such case.
I implemented this in the little script enclosed. The first
time I
launch my dialog, it pops up but the second time I launch it I
get the
following error:
You're getting a call to __new__ and a call to __init__ each time.
The second call to init fails, because the wx.Frame has already
been initialized. I made this modification: