Re: Programmer's criticism of GTK2



Maxim Koshelev <max krascoal ru> writes:

Jonathan Blandford wrote:

There's no conceptual reason this should be the case.  GtkTreeModelSort
keeps lots of iters around, and survives all sorts of mutations.  What's
the error.  Are you sure you aren't deleting the second iter as well?

The problem is in GTK. If I want to access to rows fast that I need to
store iters,
but all stored iters become invalid after any change of the model!

And again, I repeat myself.  All stored iters of a GtkListStore or
GtkTreeStore should _not_ become invalid after a change in the model.
They're only invalid when the row they point to is removed.

I
DO NOT UNDERSTAND
WHY GTK2's List/Tree model  REALISED IN SUCH INCONVINIENT WAY. E.g. if in my
application I use list,trees, hashes or anything else then I just
store pointers to the nodes and use them
everywhere in my program. Of course I cannot use pointer after freeing
but I can use another (not freed yet)
stored pointers without problems. Of course I understand that due
storing all ListStore data in GList GTK2
can't allow use iterators after changing list structure. VALID WAY IS
STORING LIST DATA INSIDE ROW
STRUCTURE!!!!

Now:
GList -> ROW
 |
GList ->ROW
 |
GList->ROW
 |
....

Valid way:
ROW
    |
ROW
    |
ROW
    |

I don't understand this at all.  Please try to explain what you mean -
it is clear we are mis-communicating.

Thanks,
-Jonathan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]