Python 3 WxPython wx.miniframe Popup Child Window GUI Desktop App Full Project For Beginners

Python 3 WxPython wx.miniframe Popup Child Window GUI Desktop App Full Project For Beginners

 

Welcome folks today in this blog post we will be displaying wx.miniframe popup child window in desktop app in python. All the full source code of the application is given below.

 

 

Get Started

 

 

In order to get started you need to install the below library using the pip command as shown below

 

pip install wxpython

 

After installing this library you need to make an app.py file and copy paste the following code

 

app.py

 

import wx

class MiniFrame(wx.MiniFrame):
    def __init__(self):
        wx.MiniFrame.__init__(self, None, -1, 'Mini Frame', 
                size=(300, 100))
        panel = wx.Panel(self, -1, size=(300, 100))
        button = wx.Button(panel, -1, "Close Me", pos=(15, 15))
        self.Bind(wx.EVT_BUTTON, self.OnCloseMe, button)
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)

    def OnCloseMe(self, event):
        self.Close(True)

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

if __name__ == '__main__':
    app = wx.PySimpleApp()
    MiniFrame().Show()
    app.MainLoop()

 

See also  Python 3 Selenium Automation Script to Download a Text or PDF File From URL in Browser Full Project For Beginners

 

If you execute the above python script by typing the below command

 

python app.py

 

 

Leave a Reply