Re: custom treemodel?
- From: "Murray Cumming" <murrayc murrayc com>
- To: "Jonathon Jongsma" <jonathon jongsma gmail com>
- Cc: Murray Cumming <murrayc murrayc com>, gtkmm-list <gtkmm-list gnome org>
- Subject: Re: custom treemodel?
- Date: Wed, 17 May 2006 16:47:01 +0200 (CEST)
> On 5/17/06, Murray Cumming <murrayc murrayc com> wrote:
>> Maybe you should just store the Palette in the list model and use
>> cell_data_func callbacks to show it in the treeview.
>
> Hmm, that's an interesting idea. I'll look into that.
>
>>
>> I've done it in Glom, but the gtkmm example is simpler.
>
> I assume you wrote the example Murray? Could you try to explain to me
> the concept behind the GlueItem and GlueList stuff in there? I know
> there are some comments in the code, but I'm having a hard time
> getting the big picture of what you're using them for.
It's all to do with the fact that you don't have much control over when
the per-iter data is deallocated. You just get to say "everything I have
allocated before now is now invalid, so I'll release it and it's your own
dam fault if you try to use it.". You do that by increasing the value of
stamp.
So I guess I keep a GlueList so I can release it when I do that
invalidation. And I guess I have a GlueItem for each iter, to be neat and
generic.
I don't think I actually invalidate the iters. And I don't think that
ListStore or TreeStore ever do that either, so it's a bit theoretical.
Maybe ListStore gets away with this (without memory leaks when iters are
forgetten) by just using basic types instead of extra memory for each
iter. Just guessing.
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]