You are here

Search & Find

A long term request has been for a search function in the roster. I haven't seen the need for this since my rosters are usually experimental and small, but my current work on optimizations for large rosters put the focus on a roster find function.

The TreeCtrl widget I use for the roster tree is very different than the text widget where I all ready have a good search function. Instead I have to do a linear search through the first text element of each item, which is perhaps not optimal. In addition, the text widget has a nice and flexible selection mechanism but TreeCtrl needs each item to be selected completely. Thus, I can't select parts of a text in an item.

Nevertheless, it is now checked into cvs. Looks pretty nice and has working menu actions as well as a next url style button. In contrast to text widget searches, which are made incrementally, I decided to trigger the search action by pressing the Return key in the entry. Also binded the Up and Down keys to previous and next searches. It has also a nice function when you hit a user that is hided in a closed group. The tree is opened so that the item is seen, and when picking next or previous, the open/closed states of all its ancestors are set to their previous state. Cool! Not sure I have covered to make bullet proof fall backs when the tree is updated dynamically.

I also suffer from the usual Tk grid bug, which doesn't make the geometry update when a gridded widget is destroyed or unmanaged.

Comments

It would be nice if you could add a screenshot to blog posts like this...

--
Mvg, Sander Devrieze.

Here I've hit the so called grid bug which has bitten me seriously. What I mean that I'm having problems finding a workaround for this problem when the geometry manager (grid) doesn't take back area when a widget has been destroyed or unmanaged. When fixed I'll upload a shot.

I tested this new feature and it is cool. My roster isn't huge but it has got around 40 people and sometimes I missed this search.