X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cae3d5e60bff8ab4c8cffe0530f21a8090f1a45f..b4772c241f010306b6f9e93edd2dabe763ff9c40:/wxPython/src/gtk/_misc.py?ds=sidebyside diff --git a/wxPython/src/gtk/_misc.py b/wxPython/src/gtk/_misc.py index ec2128941b..06eb5a5d7c 100644 --- a/wxPython/src/gtk/_misc.py +++ b/wxPython/src/gtk/_misc.py @@ -5262,6 +5262,18 @@ class DropSourcePtr(DropSource): self.__class__ = DropSource _misc_.DropSource_swigregister(DropSourcePtr) +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) + class DropTarget(object): """Proxy of C++ DropTarget class""" def __repr__(self):