X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/303f572ea95a88622fd93b33008de75f756ff068..d0ee33f5c6908b4ac5e1364381f0ef00942e3936:/wxPython/src/_dnd.i diff --git a/wxPython/src/_dnd.i b/wxPython/src/_dnd.i index bfe497b58e..29a4d2cc19 100644 --- a/wxPython/src/_dnd.i +++ b/wxPython/src/_dnd.i @@ -88,6 +88,21 @@ public: }; +%pythoncode { +def DROP_ICON(filename): + """ + Returns either a `wx.Cursor` or `wx.Icon` created from the image file + ``filename``. This function is useful with the `wx.DropSource` class + which, depending on platform accepts either a icon or a cursor. + """ + img = wx.Image(filename) + if wx.Platform == '__WXGTK__': + return wx.IconFromBitmap(wx.BitmapFromImage(img)) + else: + return wx.CursorFromImage(img) +} + + //--------------------------------------------------------------------------- // wxDropTarget should be associated with a window if it wants to be able to