Jane wrote:
> hello,
> 
> i have lot of items that i want to put into a browser so that the user can 
> see and select them. ") but since its 512 or 1024 or more items, i need some 
> filter functionality, so, when the user knows what he/she is looking for, the 
> user has a textfield or some shortcut like "/" to search the browser for some 
> substring. the browser should then only display those items that contain the 
> entered substring.
> 
> since i dont want to reinvent the wheel...anyone knows if there is some lib 
> to use for this task? it should just eat lots of string items and you can 
> throw substrings at it, which will make it spit items that contain the same 
> substring, fast.

        I think when I needed this, I just used a regular Fl_Browser
        and Fl_Input field. Any items that didn't match the search
        made the non-matching items in the browser 'hidden'.

        So in other words, all items were still in the browser at
        all times.. you can just hide the ones that don't match,
        instead of having to delete them.

        When individual items were hidden, the entries that weren't
        hidden all grouped together correctly after a redraw.

        IIRC, this feature wasn't documented.. in fact, involved
        accessing the internal FL_BLINE struct (defined in Fl_Browser.cxx)
        and manipulating the NOTDISPLAYED bit of the FL_BLINE->flags value.

        I don't remember if I simply grabbed the Fl_Browser code, and
        re-diddled it to do what I needed, or if I was able to use
        the public interface.

        I think if you acquaint yourself with the Fl_Browser code,
        you'll get it.
        
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to