Skip to content
Related Articles

Related Articles

wxPython – Frame() Constructor in Python
  • Last Updated : 10 May, 2020

In this article we will know about the frame() constructor in wxPython. frame() constructo 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 :

ParameterInput TypeDescription
parentwx.WindowParent window. Should not be None.
idwx.WindowIDControl identifier. A value of -1 denotes a default value.
titlestringTitle to the frame.
poswx.PointWindow position.
sizewx.WindowWindow size.
stylelongWindow style.
namestringWindow name.

Code:




# 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:

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :