Selections in TreeViewS and efficiency issues
- From: Matthias Kaeppler <nospam digitalraid com>
- To: gtkmm-list gnome org
- Subject: Selections in TreeViewS and efficiency issues
- Date: Thu, 07 Apr 2005 16:20:55 +0200
Hello,
it seems as if selections in TreeViewS which allow multiple selections are
handled like this:
As soon as the selection changes, on_selection_changed() is called,
which again
calls another callback function for every single row selected.
But that would mean, that if I have e.g. 5 rows selected, and I select
one more
row, the row signal handler is called for all 6 rows, although it might
not be
necessary at all to call it again for the 5 rows which were already
selected before!
So here come my questions:
1. How can I avoid this seemingly inefficient behavior? How can I keep
it from reiterating over all rows again, if I add more items to the
selection?
2. I can't handle single and multiple selections different, because I
can only react in the per-row signal handler to the select-action, but
from inside this handler I'm not aware of how I could possibly see if
this row I'm currently working on is the only one currently selected, or
just one of several. Any ideas?
3. Is there a way to check, if the row which is selected by the client
was already selected before, so I can skip execution of the handler
(this kind of is related to questions 1 and 2)?
The point behind this is that I'm performing searches on an STL
container in the signal handler, which can be quite expensive when the
container becomes large.
Now, when I double click an entry to perform some action on a row, this
signal handler is called /twice/, although the selection hasn't changed.
How can I overcome this inefficiency (I guess by first somehow solving
problems 1 and 2)?
Your input would be greatly appreciated.
PS: The web interface tells me I have lines longer than 80 characters...
Do I have to break the lines myself or what?!
--
Matthias Kaeppler
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]