event.GetFindString() returns a zero-lenght string in wxpython 2.9

I have a old code which use wx.FindReplaceDialog and bind related events to do ‘find/replace’ job. It works fine from wxpython 2.6 to 2.8. but doesn’t in wxpython 2.9.1. I found when extracing string at the event handler by event.GetFindString(), it always returns a string without any content. I tried to check dlg.GetData().GetFindString() - extracting string from the instance of wx.FindReplaceDialog, and this one is correctly. I doubted this problem came from wxWidgets. And then, I compiled the samples/dialogs, but it has no any problem. There are some similar c++ code like: event.GetFindString().c_str()

‘Replace’ job has same problem. It always replaces “” with new string - repeatedly add new string at line-end.

I am able to duplicate this on Windows, although GetReplaceString does work correctly for me. Is that the OS you are using?

I don't see anything wrong with the wrapper code for GetFindString, in fact, it is the same as the code used for GetReplaceString, so given that I would expect that the problem is with wxWidgets. But I've also confirmed that event.GetFindString works fine in the wxWidgets sample, so I'm a little stuck. I'll keep looking...

···

On 2/5/11 10:03 PM, Mark Weng wrote:

I have a old code which use wx.FindReplaceDialog and bind related events
to do 'find/replace' job. It works fine from wxpython 2.6 to 2.8. but
doesn't in wxpython 2.9.1. I found when extracing string at the event
handler by event.GetFindString(), it always returns a string without any
content. I tried to check dlg.GetData().GetFindString() - extracting
string from the instance of wx.FindReplaceDialog, and this one is
correctly. I doubted this problem came from wxWidgets. And then, I
compiled the samples/dialogs, but it has no any problem. There are some
similar c++ code like: event.GetFindString().c_str()
'Replace' job has same problem. It always replaces "" with new string -
repeatedly add new string at line-end.

--
Robin Dunn
Software Craftsman