]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/_misc.py
wxCheckListBox doesn't require wxUSE_OWNER_DRAWN when using WXUNIVERSAL
[wxWidgets.git] / wxPython / src / mac / _misc.py
index 8e67e39aced9635a270179a50aad660d69e235b6..a0bc8a30ba724cff0cc18b74f438b809fc6f4131 100644 (file)
@@ -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):