Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » GTK+
  • » implementing custom GtkTreeModels for language bindings [RSS Feed]

#1 Nov. 26, 2005 16:00:22

Owen T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

implementing custom GtkTreeModels for language bindings


On Fri, 2005-11-25 at 16:12 +0000, Duncan Coutts wrote:
> All,
>
> Language bindings want to be able to implement the GtkTreeModel
> interface. Unfortunately this is rather hard without causing a space
> leak.
>
> The issue is that to implement a the GtkTreeModel interface you must
> fill in GtkTreeIter structures. These are typically stack allocated and
> do not need to be explicitly freed. As a consequence it is not possible
> to track resources that are referenced by GtkTreeIters.

The simplest fix for this is to to use iters that don't reference
resources - put 1-3 integers into the iterator instead of a pointer.
It's easy to see how to do this for a flat model. A little trickier
for a tree, but there are various possibilities ...

(You may have to omit GTK_TREE_MODEL_ITERS_PERSIST - this will cause
some performance degradation, but things will still work.)

Regards,
Owensignature.ascDescription:This is a digitally signed message part_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Attachments:
attachment signature.asc (189 bytes)

Offline

#2 Nov. 26, 2005 18:07:51

Hans O.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

implementing custom GtkTreeModels for language bindings


Owen Taylor schreef:On Fri, 2005-11-25 at 16:12 +0000, Duncan Coutts wrote:All,

Language bindings want to be able to implement the GtkTreeModel
interface. Unfortunately this is rather hard without causing a space
leak.

The issue is that to implement a the GtkTreeModel interface you must
fill in GtkTreeIter structures. These are typically stack allocated and
do not need to be explicitly freed. As a consequence it is not possible
to track resources that are referenced by GtkTreeIters.I had no problems at all implementing a GtkTreeModel for mzgtk2 (whichimplements alist that gets its data via function callbacks). If you want to have the
sources of the model, I can send you them.

--
Hans Oesterholt-Dijkema



_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

  • Root
  • » GTK+
  • » implementing custom GtkTreeModels for language bindings [RSS Feed]

Board footer

Moderator control

Enjoy the 20th of January
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support