******************* wx.CustomDataObject ******************* Inheritance diagram for `wx.CustomDataObject`: | .. inheritance-diagram:: wx.CustomDataObject | Description =========== `wx.CustomDataObject` is a specialization of `wx.DataObjectSimple `_ for some application-specific data in arbitrary (either custom or one of the standard ones). The only restriction is that it is supposed that this data can be copied bitwise (i.e. with ``memcpy()``), so it would be a bad idea to make it contain a C++ object (though C struct is fine). By default, `wx.CustomDataObject` stores the data inside in a buffer. To put the data into the buffer you may use either `SetData <#SetData>`_ or `TakeData <#TakeData>`_ depending on whether you want the object to make a copy of data or not. If you already store the data in another place, it may be more convenient and efficient to provide the data on-demand which is possible too if you override the virtual functions mentioned below. .. seealso:: `wx.DataObject `_ Derived From ^^^^^^^^^^^^^ * `wx.DataObjectSimple `_ * `wx.DataObject `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetData <#GetData>`_ * `GetSize <#GetSize>`_ * `TakeData <#TakeData>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Data <#Data>`_ * `Size <#Size>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(format) `wx.CustomDataObject` is a specialization of `wx.DataObjectSimple `_ for some application-specific data in arbitrary format. Python strings are used for getting and setting data, but any picklable object can easily be transfered via strings. A copy of the data is stored in the data object. **Parameters:** * `format` (`wx.DataFormat `_) | **Returns:** `wx.CustomDataObject `_ -------- .. method:: GetData() Returns a pointer to the data. | **Returns:** `PyObject` -------- .. method:: GetSize() Returns the data size in bytes. | **Returns:** `long` -------- .. method:: TakeData(string) Copy the data value to the data object. **Parameters:** * `string` (string): This method expects a string in wxPython. You can pass nearly any object by pickling it first. | **Returns:** `bool` -------- Properties ^^^^^^^^^^ .. attribute:: Data See `GetData <#GetData>`_ and `SetData <#SetData>`_ .. attribute:: Size See `GetSize <#GetSize>`_