Drag n' Drop works different for Unicode and ANSI versions of wxPython
Ophir Horowitz
Ophir at egloomedia.com
Thu Aug 2 05:16:43 PDT 2007
Hi!
I use python2.4 with wxPython 2.8.4.0 Unicode and I have encountered a
weird problem with Drag n' Drop.
I want to drag texts from my application and drop them on a text box
inside a browser.
When I wrote this code a weird thing happened: it worked only in Firefox
and not in Internet Explorer.
Even weirder is the fact that when I uninstalled the wxPython Unicode
version and installed the ANSI version, the Drag n' Drop started to
work!
Of course, this is not a solution, because I need Unicode support in my
application...
Here's a simplified code that shows the problem:
import wx
app=wx.PySimpleApp()
def press(evt):
text_object=wx.TextDataObject()
text_object.SetText(txt.GetValue())
dropSource = wx.DropSource(txt)
dropSource.SetData(text_object)
result = dropSource.DoDragDrop(wx.Drag_CopyOnly)
frame = wx.Frame(None,size=(200,200))
frame.SetBackgroundColour("#EEEEEE")
txt = wx.TextCtrl(frame,-1,pos=(50,50))
txt.SetValue('hello')
txt.Bind(wx.EVT_LEFT_DOWN,press)
frame.Show()
app.MainLoop()
Can someone please help?
Thanks,
Ophir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070802/531841e7/attachment.htm
More information about the wxpython-users
mailing list