views:

201

answers:

2

I feel like I must be missing something completely obvious, but I don't see how to search for text in a multi line textctrl. Is there an API for searching forwards and backwards through a text control?

I do not want suggestions involving the FindReplaceDialog, that's not an option I wish to explore. I will be creating an entry widget and want to search for whatever the user types in. I know how to do the bindings and whatnot, I just don't see how to find occurrences of a string within a TextCtrl.

A: 

I think you're expected to get the text using GetValue and search it as a string.

RichieHindle
Actually just .Value . You don't need to call getters explicitly in Python.
Matthew Flaschen
You gotta be kidding me!? So I have to keep track of rows and columns myself, as well as the overhead of duplicating my data? (one copy owned by the control, one copy for searching). *sigh*. I guess I've become spoiled by Tk's incredible text widget. I sure hope someone comes up with a better answer.
Bryan Oakley
A: 

You could try the SCiTE widget... it should blow Tk's text widget out of the water. It's integrated into wxPython's stc module

Jim Carroll
I'm not sure about the "blow Tk's text widget out of the water" comment. The python widget has more features but I don't think it's quite as elegant or easy to use. <shrug>.
Bryan Oakley