File: wx.Object.txt

package info (click to toggle)
wxpython4.0 4.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 232,540 kB
  • sloc: cpp: 958,937; python: 233,059; ansic: 150,441; makefile: 51,662; sh: 8,687; perl: 1,563; javascript: 584; php: 326; xml: 200
file content (358 lines) | stat: -rw-r--r-- 12,172 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.Object:

==========================================================================================================================================
|phoenix_title|  **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. 

:ref:`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. 

:ref:`wx.Object`  can be used to implement :ref:`reference counted <reference counting>`  objects, such as :ref:`wx.Pen`, :ref:`wx.Bitmap`  and others (see :ref:`this list <stock items>`). See :ref:`wx.RefCounter`  and :ref:`Reference Counting <reference counting>`  for more info about reference counting. 





         



.. seealso:: :ref:`wx.ClassInfo`, :ref:`Debugging`, :ref:`Reference Counting <reference counting>`, ObjectDataRef, :ref:`wx.ObjectDataPtr`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>Object</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.Object_inheritance.png" alt="Inheritance diagram of Object" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,92,35"/> </map> 
   </p>
   </div>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.AcceleratorTable`, :ref:`wx.Accessible`, :ref:`wx.adv.Animation`, :ref:`ArchiveClassFactory`, :ref:`ArchiveEntry`, :ref:`wx.ArtProvider`, :ref:`AutomationObject`, :ref:`wx.BitmapHandler`, :ref:`Client`, :ref:`wx.Clipboard`, :ref:`wx.Colour`, :ref:`wx.ColourData`, :ref:`wx.propgrid.ColourPropertyValue`, :ref:`wx.Command`, :ref:`wx.CommandProcessor`, :ref:`wx.ConfigBase`, :ref:`Connection`, :ref:`ConnectionBase`, :ref:`wx.ContextHelp`, :ref:`wx.dataview.DataViewIconText`, :ref:`wx.dataview.DataViewRenderer`, :ref:`wx.DC`, :ref:`DDEClient`, :ref:`DocTemplate`, :ref:`wx.DragImage`, :ref:`EncodingConverter`, :ref:`wx.Event`, :ref:`wx.EvtHandler`, :ref:`wx.FileHistory`, :ref:`wx.FileSystem`, :ref:`wx.FileSystemHandler`, :ref:`FilterClassFactory`, :ref:`wx.FindReplaceData`, :ref:`wx.FontData`, :ref:`wx.FSFile`, :ref:`wx.GDIObject`, :ref:`wx.glcanvas.GLContext`, :ref:`wx.GraphicsObject`, :ref:`wx.GraphicsRenderer`, :ref:`wx.grid.GridTableBase`, :ref:`HashTable`, :ref:`wx.HelpControllerBase`, :ref:`wx.html.HtmlCell`, :ref:`wx.html.HtmlDCRenderer`, :ref:`wx.html.HtmlEasyPrinting`, :ref:`wx.html.HtmlFilter`, :ref:`wx.html.HtmlHelpData`, :ref:`wx.html.HtmlLinkInfo`, :ref:`wx.html.HtmlTagHandler`, :ref:`wx.Image`, :ref:`wx.ImageHandler`, :ref:`wx.ImageList`, :ref:`wx.IndividualLayoutConstraint`, :ref:`wx.adv.Joystick`, :ref:`wx.adv.LayoutAlgorithm`, :ref:`wx.LayoutConstraints`, :ref:`wx.ListItem`, :ref:`wx.Mask`, :ref:`wx.MenuItem`, :ref:`wx.Metafile`, :ref:`Module`, :ref:`wx.PageSetupDialog`, :ref:`wx.PageSetupDialogData`, :ref:`wx.propgrid.PGCell`, :ref:`wx.propgrid.PGEditor`, :ref:`wx.propgrid.PGEditorDialogAdapter`, :ref:`wx.propgrid.PGProperty`, :ref:`wx.PrintData`, :ref:`wx.PrintDialog`, :ref:`wx.PrintDialogData`, :ref:`wx.Printer`, :ref:`wx.Printout`, :ref:`wx.PrintPreview`, :ref:`Quantize`, :ref:`wx.RegionIterator`, :ref:`wx.richtext.RichTextAction`, :ref:`wx.richtext.RichTextDrawingContext`, :ref:`wx.richtext.RichTextDrawingHandler`, :ref:`wx.richtext.RichTextFieldType`, :ref:`wx.richtext.RichTextFileHandler`, :ref:`wx.richtext.RichTextFontTable`, :ref:`wx.richtext.RichTextFormattingDialogFactory`, :ref:`wx.richtext.RichTextHeaderFooterData`, :ref:`wx.richtext.RichTextImageBlock`, :ref:`wx.richtext.RichTextObject`, :ref:`wx.richtext.RichTextPrinting`, :ref:`wx.richtext.RichTextProperties`, :ref:`wx.richtext.RichTextRenderer`, :ref:`wx.richtext.RichTextStyleDefinition`, :ref:`wx.richtext.RichTextStyleSheet`, :ref:`wx.Sizer`, :ref:`wx.SizerItem`, :ref:`SockAddress`, :ref:`SocketBase`, :ref:`wx.adv.Sound`, :ref:`StringTokenizer`, :ref:`wx.SystemOptions`, :ref:`TCPClient`, :ref:`TCPConnection`, :ref:`TCPServer`, :ref:`wx.ToolBarToolBase`, :ref:`wx.ToolTip`, :ref:`URI`, :ref:`Variant`, :ref:`wx.html2.WebViewFactory`, :ref:`wx.xml.XmlDocument`, :ref:`wx.xrc.XmlResource`, :ref:`wx.xrc.XmlResourceHandler`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.Object.__init__`                                                      Default constructor; initializes to ``None`` the internal reference data.
:meth:`~wx.Object.Destroy`                                                       Deletes the C++ object this Python object is a proxy for.
:meth:`~wx.Object.GetClassInfo`                                                  This virtual function is redefined for every class that requires run-time type information, when using the ``DECLARE_CLASS``  macro (or similar).
:meth:`~wx.Object.GetClassName`                                                  Returns the class name of the C++ class using ``RTTI``.
:meth:`~wx.Object.GetRefData`                                                    Returns the ``Object.m_refData``  pointer, i.e. the data referenced by this object.
:meth:`~wx.Object.IsSameAs`                                                      Returns ``True`` if this object has the same data pointer as `obj`.
:meth:`~wx.Object.Ref`                                                           Makes this object refer to the data in `clone`.
:meth:`~wx.Object.SetRefData`                                                    Sets the ``Object.m_refData``  pointer.
:meth:`~wx.Object.UnRef`                                                         Decrements the reference count in the associated data, and if it is zero, deletes the data.
:meth:`~wx.Object.UnShare`                                                       This is the same of :meth:`~Object.AllocExclusive`   but this method is public.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.Object.ClassInfo`                                                     See :meth:`~wx.Object.GetClassInfo`
:attr:`~wx.Object.ClassName`                                                     See :meth:`~wx.Object.GetClassName`
:attr:`~wx.Object.RefData`                                                       See :meth:`~wx.Object.GetRefData` and :meth:`~wx.Object.SetRefData`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.Object(object)

   **Possible constructors**::

       Object()
       
       Object(other)
       
   
   This is the root class of many of the wxWidgets classes.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      Default constructor; initializes to ``None`` the internal reference data.                   
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, other)`
      
      Copy constructor.                  
      
      Sets the internal ``Object.m_refData``  pointer to point to the same instance of the ObjectRefData-derived class pointed by  ``other``   and increments the refcount of  ``Object.m_refData``.                  
      
      
      :param `other`: 
      :type `other`: wx.Object
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Destroy(self)

      Deletes the C++ object this Python object is a proxy for.  





   .. method:: GetClassInfo(self)

      This virtual function is redefined for every class that requires run-time type information, when using the ``DECLARE_CLASS``  macro (or similar).                  

      :rtype: :ref:`wx.ClassInfo`








   .. method:: GetClassName(self)

      Returns the class name of the C++ class using ``RTTI``. 

      :rtype: :ref:`wx.Char`








   .. method:: GetRefData(self)

      Returns the ``Object.m_refData``  pointer, i.e. the data referenced by this object.                  

                

      :rtype: :ref:`wx.ObjectRefData`







      .. seealso:: :meth:`Ref` , :meth:`UnRef` , ``Object.m_refData``, :meth:`SetRefData` , :ref:`wx.ObjectRefData`    








   .. method:: IsSameAs(self, obj)

      Returns ``True`` if this object has the same data pointer as `obj`.                  

      Notice that ``True`` is returned if the data pointers are ``None`` in 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. 

                


      :param `obj`: 
      :type `obj`: wx.Object




      :rtype: `bool`







      .. seealso:: :ref:`Reference Counting <reference counting>`    








   .. method:: Ref(self, clone)

      Makes this object refer to the data in `clone`.                  




      :param `clone`: The object to 'clone'.  
      :type `clone`: wx.Object




                  



      .. note:: 

         First this function calls :meth:`UnRef`   on itself to decrement (and perhaps free) the data it is currently referring to. It then sets its own ``Object.m_refData``  to point to that of `clone`, and increments the reference count inside the data.  







      .. seealso:: :meth:`UnRef` , :meth:`SetRefData` , :meth:`GetRefData` , :ref:`wx.ObjectRefData`    








   .. method:: SetRefData(self, data)

      Sets the ``Object.m_refData``  pointer.                  

                


      :param `data`: 
      :type `data`: wx.ObjectRefData






      .. seealso:: :meth:`Ref` , :meth:`UnRef` , :meth:`GetRefData` , :ref:`wx.ObjectRefData`    








   .. method:: UnRef(self)

      Decrements the reference count in the associated data, and if it is zero, deletes the data.                  

      The ``Object.m_refData``  member is set to ``None``. 

                 



      .. seealso:: :meth:`Ref` , :meth:`SetRefData` , :meth:`GetRefData` , :ref:`wx.ObjectRefData`    








   .. method:: UnShare(self)

      This is the same of :meth:`AllocExclusive`   but this method is public.                   





   .. attribute:: ClassInfo

      See :meth:`~wx.Object.GetClassInfo`


   .. attribute:: ClassName

      See :meth:`~wx.Object.GetClassName`


   .. attribute:: RefData

      See :meth:`~wx.Object.GetRefData` and :meth:`~wx.Object.SetRefData`