Friday, September 5, 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
32269 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6638 POSTS0 COMMENTS
Nicole Veronica
11802 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11866 POSTS0 COMMENTS
Shaida Kate Naidoo
6752 POSTS0 COMMENTS
Ted Musemwa
7027 POSTS0 COMMENTS
Thapelo Manthata
6704 POSTS0 COMMENTS
Umr Jansen
6721 POSTS0 COMMENTS