wx.Object¶
This is the root class of many of the wxWidgets classes.
It declares a virtual destructor which ensures that destructors get called for all derived class objects where necessary.
wx.Object is the hub of a dynamic object creation scheme, enabling a program to create instances of a class only knowing its string class name, and to query the class hierarchy.
The class contains optional debugging versions of new and delete, which can help trace memory allocation and deallocation problems.
wx.Object can be used to implement reference counted objects, such as wx.Pen, wx.Bitmap and others (see this list). See wx.RefCounter and Reference Counting for more info about reference counting.
See also
wx.ClassInfo, Debugging , Reference Counting, ObjectDataRef, wx.ObjectDataPtr
Class Hierarchy¶
Known Subclasses¶
wx.AcceleratorTable, wx.Accessible, wx.adv.Animation, ArchiveClassFactory , ArchiveEntry , wx.ArtProvider, AutomationObject , wx.BitmapHandler , Client , wx.Clipboard, wx.Colour, wx.ColourData, wx.propgrid.ColourPropertyValue, wx.Command, wx.CommandProcessor, wx.ConfigBase, Connection , ConnectionBase , wx.ContextHelp, wx.DC, DDEClient , wx.dataview.DataViewIconText, wx.dataview.DataViewRenderer, DocTemplate , wx.DragImage, EncodingConverter , wx.Event, wx.EvtHandler, wx.FSFile, wx.FileHistory, wx.FileSystem, wx.FileSystemHandler, FilterClassFactory , wx.FindReplaceData, wx.FontData, wx.GDIObject, wx.glcanvas.GLContext, wx.GraphicsObject, wx.GraphicsRenderer, wx.grid.GridTableBase, HashTable , wx.HelpControllerBase, wx.html.HtmlCell, wx.html.HtmlDCRenderer, wx.html.HtmlEasyPrinting, wx.html.HtmlFilter, wx.html.HtmlHelpData, wx.html.HtmlLinkInfo, wx.html.HtmlTagHandler, wx.Image, wx.ImageHandler, wx.ImageList, wx.IndividualLayoutConstraint, wx.adv.Joystick, wx.adv.LayoutAlgorithm, wx.LayoutConstraints, wx.ListItem, wx.Mask, wx.MenuItem, wx.Metafile, Module , wx.propgrid.PGCell, wx.propgrid.PGEditor, wx.propgrid.PGEditorDialogAdapter, wx.propgrid.PGProperty, wx.PageSetupDialog, wx.PageSetupDialogData, wx.PrintData, wx.PrintDialog, wx.PrintDialogData, wx.PrintPreview, wx.Printer, wx.Printout, Quantize , wx.RegionIterator, wx.richtext.RichTextAction, wx.richtext.RichTextDrawingContext, wx.richtext.RichTextDrawingHandler, wx.richtext.RichTextFieldType, wx.richtext.RichTextFileHandler, wx.richtext.RichTextFontTable, wx.richtext.RichTextFormattingDialogFactory, wx.richtext.RichTextHeaderFooterData, wx.richtext.RichTextImageBlock, wx.richtext.RichTextObject, wx.richtext.RichTextPrinting, wx.richtext.RichTextProperties, wx.richtext.RichTextRenderer, wx.richtext.RichTextStyleDefinition, wx.richtext.RichTextStyleSheet, wx.Sizer, wx.SizerItem, SockAddress , SocketBase , wx.adv.Sound, StringTokenizer , wx.SystemOptions, TCPClient , TCPConnection , TCPServer , wx.ToolBarToolBase, wx.ToolTip, URI , Variant , wx.html2.WebViewFactory, wx.xml.XmlDocument, wx.xrc.XmlResource, wx.xrc.XmlResourceHandler
Methods Summary¶
Default constructor; initializes to |
|
Deletes the C++ object this Python object is a proxy for. |
|
This virtual function is redefined for every class that requires run-time type information, when using the |
|
Returns the class name of the C++ class using |
|
Returns the |
|
Returns |
|
Makes this object refer to the data in clone. |
|
Sets the |
|
Decrements the reference count in the associated data, and if it is zero, deletes the data. |
|
This is the same of |
Properties Summary¶
See |
|
See |
|
See |
Class API¶
- class wx.Object(object)¶
Possible constructors:
Object() -> None Object(other) -> None
This is the root class of many of the wxWidgets classes.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Default constructor; initializes to
Nonethe internal reference data.- Return type:
None
__init__ (self, other)
Copy constructor.
Sets the internal
Object.m_refDatapointer to point to the same instance of the ObjectRefData-derived class pointed byotherand increments the refcount ofObject.m_refData.- Parameters:
other (wx.Object)
- Return type:
None
- Destroy(self)¶
Deletes the C++ object this Python object is a proxy for.
- Return type:
None
- GetClassInfo(self)¶
This virtual function is redefined for every class that requires run-time type information, when using the
DECLARE_CLASSmacro (or similar).- Return type:
- GetClassName(self)¶
Returns the class name of the C++ class using
RTTI.- Return type:
str
- GetRefData(self)¶
Returns the
Object.m_refDatapointer, i.e. the data referenced by this object.- Return type:
wx.ObjectRefData
See also
Ref,UnRef,Object.m_refData,SetRefData, wx.ObjectRefData
- IsSameAs(self, obj)¶
Returns
Trueif this object has the same data pointer as obj.Notice that
Trueis returned if the data pointers areNonein both objects.This function only does a shallow comparison, i.e. it doesn’t compare the objects pointed to by the data pointers of these objects.
- Parameters:
obj (wx.Object)
- Return type:
bool
See also
- Ref(self, clone)¶
Makes this object refer to the data in clone.
- Parameters:
clone (wx.Object) – The object to ‘clone’.
- Return type:
None
Note
First this function calls
UnRefon itself to decrement (and perhaps free) the data it is currently referring to. It then sets its ownObject.m_refDatato point to that of clone, and increments the reference count inside the data.See also
UnRef,SetRefData,GetRefData, wx.ObjectRefData
- SetRefData(self, data)¶
Sets the
Object.m_refDatapointer.- Parameters:
data (wx.ObjectRefData)
- Return type:
None
See also
Ref,UnRef,GetRefData, wx.ObjectRefData
- UnRef(self)¶
Decrements the reference count in the associated data, and if it is zero, deletes the data.
The
Object.m_refDatamember is set toNone.- Return type:
None
See also
Ref,SetRefData,GetRefData, wx.ObjectRefData
This is the same of
AllocExclusivebut this method is public.- Return type:
None
Properties¶
- ClassInfo¶
See
GetClassInfo
- ClassName¶
See
GetClassName
- RefData¶
See
GetRefDataandSetRefData
