Re: RFC: new features



On 13 January 2012 22:21, Paul Davis <paul linuxaudiosystems com> wrote:
> there is a bigger issue there, i think. in an ideal world, you don't
> want to base the date store for the TreeView on an object, but on an
> interface.  then you want a series of adapters/wrappers that wrap data
> structures implemented in any language (or any language with a GTK
> binding) with the required interface. some of which might be "null"
> adapters that just do passthrough to the underlying data object.
>
> there's nothing more stupid that taking a "native" data structure
> (e.g. a C++ list, a python array, some app-specific creation, etc) and
> having to copy the data out of it into some GObject-based data
> structure before being able to give it to the TreeView. well, ok,

Off topic, but I believe that's more or less how it works now.

You can define your own model that implements the GtkTreeModelIface
and TreeView will then display from that. You need to put your data
items into GValues but you don't need to make GObjects for them. And
the GValues only need to be made on demand for the items which are
being sent for display (the current window), you don't need to pack
the whole thing.

John Lindgren	posted a complete small example a few months ago (though
I think he's missing set-fixed-height mode in that code):

http://pastebin.com/45br5X3Z

You can display *huge* datasets directly from your application's
internal structures.

John


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