Try hacking around with this… I had a similar issue with TaskBar Icon/Iconize
You could also try binding wx.EVT_ENTER_WINDOW to SetFocus(); Raise()
Maybe I’m not understanding what type of effect you are wanting.
Adding wx.CallAfter of CallLater with this combined with the frames EVT_ACTIVATE or EVT_ACTIVATE_APP should work fine for raising any frame that is under the mouse.
If anything past this point of custimization is needed, then you are probably looking at writing some new code to handle it.
···
On Thursday, February 6, 2014 9:21:01 AM UTC-6, Leon wrote:
def OnTaskBarActivate(self, event=None):
if wx.VERSION_STRING.startswith(‘2.9’) and not PHOENIX:#BUG…? wx >= wx2.9.4.0 why have to do it twice… probably the order of events.
self.parent.Iconize(False)
self.parent.Show(True)
self.parent.Raise()
self.parent.Iconize(False)
self.parent.Show(True)
self.parent.Raise()
else:
if self.parent.IsIconized():
self.parent.Iconize(False)
if not self.parent.IsShown():
self.parent.Show(True)
self.parent.Raise()
print('OnTaskBarActivate Raise()')
def BringWindowToFront(self):
try: # It’s possible for this event to come when the frame is closed.
self.GetTopWindow().Raise()
except Exception as exc:
pass
def OnActivateApp(self, event):
if not event.GetActive(): # Removing this screws up context wx.EVT_HELP/ContextHelp
return
# self.BringWindowToFront()
If you really need to use SELECTED, then change the EVT_LEFT_UP to EVT_LEFT_DOWN in the attached sample app.
In the OnLeftDown def,
you will need to figure out programmatically what the SELECTED event does for you then call the frame depending on what infos you want to send it.
I have tried to use EVT_LEFT_UP and EVT_LEFT_DOWN.
And played around with event.Skip(),
but either the EVT_LIST_ITEM_SELECTED or the EVT_LEFT_UP is not detected.
I have attached open_the_frame_EVT_LEFT_UP.py to demonstrate.
I have also tried to use the EVT_ENTER_WINDOW in order to raise the Frame1 because Frame2 is on top because of FRAME_FLOAT_ON_PARENT.
But FRAME_FLOAT_ON_PARENT seems to be stronger
I have attached open_the_frame_EVT_ENTER_WINDOW.py to demonstrate.