+ # Drag
+ def OnRightClick(self, evt):
+ do = MyDataObject()
+ do.SetData(str(evt.GetId()))
+ bm = evt.GetEventObject().GetBitmapLabel()
+ if wx.Platform != '__WXMAC__':
+ icon = wx.EmptyIcon()
+ icon.CopyFromBitmap(bm)
+ dragSource = wx.DropSource(self, icon)
+ else: # on Mac DragSource requires cursor (but does not work anyway)
+ curs = wx.CursorFromImage(wx.ImageFromBitmap(bm))
+ dragSource = wx.DropSource(self, curs)
+ dragSource.SetData(do)
+ g.frame.SetStatusText('Release the mouse button over the test window')
+ dragSource.DoDragDrop()
+