[wxPython-users] Icon while doing DnD?

Robin Dunn robin at alldunn.com
Mon Mar 26 10:58:50 PDT 2007


Basil Shubin wrote:
> Hi friends!
> 
> I use following code to initiate DnD somewhere in my app:
> ...
> item = self.presenter.getIndex()
> itemdata = cPickle.dumps(item, 1)
> data = wx.CustomDataObject('IndexModel')
> data.SetData(itemdata)
> 
> dropSource = wx.DropSource(self.view.index)
> dropSource.SetData(data)
> result = dropSource.DoDragDrop()
> ...
> 
> When I am doing DnD, I can see dragged object just as simple icon.
> 
> So my question is: is it possible to show text string in a box instead 
> of icon when DnD?

You can set a cursor or icon to use when creating the DropSource object, 
or you can override the GiveFeedback method and use it to draw something 
else on screen if desired.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list