On Fri, Nov 16, 2007 at 07:10:48PM +0000, place wrote:
Johannes wrote:
Very nice! I was text search a lot. What about incremental searching as you type? I don't mind the title bar...
Hmm... I'd have to modify findtext.cc some... I may get around to it at some point here, though I'm feeling the need to look into what's going on with redirection and gzip, so if anybody else gets there first, it'll be fine with me! :)
I was thinking about something like: diff -r f18e37a8e3ac src/dialog.cc --- a/src/dialog.cc Fri Nov 16 20:25:11 2007 +0100 +++ b/src/dialog.cc Fri Nov 16 20:27:18 2007 +0100 @@ -141,14 +141,6 @@ static void findtext_search_cb(Widget *, const char *key = tf->i->value(); bool case_sens = tf->cb->value(); - /* - * Somehow fltk even regards the first loss of focus for the - * window as a WHEN_ENTER_KEY_ALWAYS event. - */ - int e = event_key(); - if ((e != ReturnKey) && (e != LeftButton)) - return; - if (key[0] != '\0') a_UIcmd_findtext_search(tf->bw, key, case_sens); @@ -176,7 +168,7 @@ TextFinder::TextFinder(int ww, int wh, B begin(); i = new Input(0, 0, ww, ih); - i->when(WHEN_ENTER_KEY_ALWAYS); + i->when(WHEN_CHANGED); i->callback(findtext_search_cb, this); cb = new CheckButton(0, ih, ww, wh-ih-bh, "Case-sensitive"); on top of your patch of course. Works for me. Cheers, Johannes