Hi,
I have a ToasterBox window
(http://xoomer.alice.it/infinity77/main/ToasterBox.html),
I want it always stay on top even the main frame is iconized or not active.
This window is with flag STAY_ON_TOP already, but it doesn't work when main
frame is not active.
I tried that:
class MyToasterBoxWindow(ToasterBox.ToasterBoxWindow):
def Show(self, show=True):
result = ToasterBox.ToasterBoxWindow.Show(self, show)
self.Raise()
return result
class MyToasterBox(ToasterBox.ToasterBox):
"""
Modified ToasterBox to make it always stay on top even the parent window
is closed or hidden.
"""
def __init__(self, parent,
tbstyle=ToasterBox.TB_SIMPLE,
windowstyle=ToasterBox.DEFAULT_TB_STYLE,
closingstyle=ToasterBox.TB_ONTIME,
scrollType=ToasterBox.TB_SCR_TYPE_DU):
try:
# Given None parent to prevent:
# parent.Bind(wx.EVT_ICONIZE, lambda evt:
# [w.Hide() for w in winlist])
# in ToasterBox.py.
super(MyToasterBox, self).__init__(None,
tbstyle, windowstyle, closingstyle, scrollType)
except:
pass
self._tb = MyToasterBoxWindow(self._parent, self,
self._tbstyle,
self._windowstyle,
self._closingstyle,
scrollType=scrollType)
def destroy(event=None):
if self._tb:
self._tb.Destroy()
self._tb = None
if event:
event.Skip()
#parent.Bind(wx.EVT_CLOSE, destroy)
parent.Bind(wx.EVT_WINDOW_DESTROY, destroy)
But that only make it work when main frame is iconized. If I do not iconize
it, just click on another program to make main frame is inactive, the
ToasterBoxWindow wouldn't show on top even I overwrite the Show method to
Raise it.
How can I make it always show on top without any exception?
Thanks to you very much.
···
–
View this message in context: http://www.nabble.com/How-to-make-a-window-always-(without-exception)-stay-on-top--tp22120467p22120467.html
Sent from the wxPython-users mailing list archive at Nabble.com.