Added wx.DROP_ICON()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-05-17 00:27:11 +00:00
parent a1539a1ff2
commit f66cece380

View File

@@ -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 // wxDropTarget should be associated with a window if it wants to be able to