Saturday, June 13, 2026
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
32515 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6897 POSTS0 COMMENTS
Nicole Veronica
12013 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6964 POSTS0 COMMENTS