X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/303f572ea95a88622fd93b33008de75f756ff068..3a9becbd5439254a77e7dbc0278d80117a397264:/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