X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc61cdb2681bc7d5eee8f5b2f5f7c60984dce114..db679b8c836e69c111cdc31e62cf92cebe4f938f:/wxPython/src/mac/_misc.py diff --git a/wxPython/src/mac/_misc.py b/wxPython/src/mac/_misc.py index 8e67e39ace..a0bc8a30ba 100644 --- a/wxPython/src/mac/_misc.py +++ b/wxPython/src/mac/_misc.py @@ -5270,6 +5270,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):