how to "stay on top"?

Hi,

I'd like to have a modeless dialog able to stay on top of all windows, no matter what. How can I do this? I used the wxSTAY_ON_TOP style but it doesn't change anything.

Below is my sample app.
Platform is W2K, Python version 2.2.1, wxPython version 2.3.3.1u.

Thank you,

Cristina.

···

------------------------
# ui2arx.py
from wxPython.wx import *

wxID_DUMMYDLG = 1401
wxID_DUMMYDLGTEXT = 1402

class DummyDlg(wxDialog):
     def __init__(self, someText):
         wxDialog.__init__(self, None, wxID_DUMMYDLG, 'Dialog caption', wxPoint(300, 250), wxSize(400, 72), wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP )
         EVT_CLOSE(self, self.OnClose)

         wxStaticText(self, wxID_DUMMYDLGTEXT, someText, wxPoint(12, 8), wxSize(260, 17))

     def OnClose(self, event):
         self.Destroy()

def strmain(someText):
     class DummyApp(wxApp):
         def OnInit(self):
                 dlg = DummyDlg(someText)
                 dlg.Show(true)
                 self.SetTopWindow(dlg)
                 return true

     app = DummyApp(0)
     app.MainLoop()

#----------------------------------------------------------------------
if __name__ == '__main__':
     if ( len(sys.argv)< 2 ):
         print "Usage: python ui2arx.py someText"
         sys.exit(1)

     strmain(sys.argv[1])

-------------------------------------------------------
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.

Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.
Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
de virusi.

Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
Please be aware that there is a risk involved whenever opening e-mail attachments
to your computer and that MobiFon is not responsible for any damages caused by
viruses.

C. Iacob wrote:

Hi,

I'd like to have a modeless dialog able to stay on top of all windows, no matter what. How can I do this? I used the wxSTAY_ON_TOP style but it doesn't change anything.

If it is not going to be modal then you can just use a wxFrame with a wxPanel in it, then it will stay on top since that style does work with frames.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!