0

I wrote a small code to test this:

import wx
import wx.lib.sized_controls as sc

class TestDialog(sc.SizedDialog):
    def __init__(self, parent):
        sc.SizedDialog.__init__(self, parent, title="dialog",
                 style=wx.DEFAULT_DIALOG_STYLE|wx.STAY_ON_TOP)

if __name__ == "__main__":
    app = wx.App()
    myframe = wx.Frame(None, -1, title="frame")
    myframe.Show()
    mydialog = TestDialog(frame)
    mydialog.ShowModal()
    app.MainLoop()  

In which I intend for mydialog to always show on top of all other windows including myframe. I think that is the intention of the style wx.STAY_ON_TOP. However, mydialog show up on top but if I click on myframe, it will cover mydialog, which I don't want. Do you know any solution for this? Thank you.

HuongOrchid
  • 332
  • 3
  • 15
  • Once `TestDialog(frame)` is changed to `TestDialog(myframe)` this works properly. What environment are you running this in? Try running it off the command line. – Rolf of Saxony Jul 19 '18 at 06:52
  • @RolfofSaxony: you are right that is my typo when I tried to change name of frame from 'frame' to 'myframe. My Linux is 2.6.35.14, pyhon: 2.7.0, wx: 2.8.12. I ran it from terminal. – HuongOrchid Jul 19 '18 at 21:21

0 Answers0