]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/_misc.py
Applied patch [ 1204244 ] [wxMSW] Use Win2K look (MS Shell Dlg 2) if possible
[wxWidgets.git] / wxPython / src / gtk / _misc.py
index ec2128941beca3da018dec8fc0fb243247707896..06eb5a5d7c37f6ac5f6076cf30964b0d3bc4286a 100644 (file)
@@ -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):