Friday, October 24, 2025
HomeLanguageswxPython – Frame() Constructor in Python

wxPython – Frame() Constructor in Python

In this article we will know about the frame() constructor in wxPython. frame() constructor is a constructor for the wx.Frame class of wxPython. This constructor is used to set different attributes of the frame.
 

Syntax : 
 

wx.Frame(parent, id=ID_ANY, title="", pos=DefaultPosition,
         size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)

Parameters : 

 

Parameter Input Type Description
parent wx.Window Parent window. Should not be None.
id wx.WindowID Control identifier. A value of -1 denotes a default value.
title string Title to the frame.
pos wx.Point Window position.
size wx.Window Window size.
style long Window style.
name string Window name.

 

Code: 
 

Python3




# import wxPython
import wx
 
app = wx.App()
 
# create frame using Frame() constructor
frame = wx.Frame(None, id = 10, title ="Frame",
                      pos = wx.DefaultPosition,
                         size = wx.DefaultSize,
                style = wx.DEFAULT_FRAME_STYLE,
                               name = "frame")
 
# show frame
frame.Show(True)
 
app.MainLoop()


Output: 
 

 

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS