Re: tree model



Am Tue, 12 May 2009 08:10:11 +0200
schrieb Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com>:

> 2009/5/12 Matthias Clasen <matthias clasen gmail com>:
> >>
> >> I should have been slightly more clear:  I am interested in being
> >> able to provide a GtkTreeModel for those people who wish to use it
> >> without having to link to libgtk myself.
> >>
> >> So the problem with using GNode: GtkTreeView doesn't use it.
> >
> > I don't see why this is something we should be eager to support.
> > Since tree models are only useful with GTK+ widgets, it doesn't
> > seem like a big burden to link against gtk when you are providing
> > tree models. The consumer of your model will already link against
> > gtk anyway.
> 
> I recall having issues with this... But my memory serves me badly...
> 
> Is it that gtk_init() requires a connection to X? That way if I am
> writing mydaemon based on mylib.so then mydaemon will require X to
> run. Maybe gtk_init_check() can work around this, or maybe the library
> does not need gtk_init_* in the first place... I  am hoping that I can
> use the same data model in the daemon and in the GUI app so that I
> don't have to wrap it in a GtkTreeModel when using it in the GUI app.
> 
> Anyway, I just want to back Ryan up on this one. I've been wanting a
> GTreeModel for the exact same purpose as Ryan on more than one
> occasion.

Hey,

if the main issue is, as you describe, not having to run X11, then
gtk_init_check is all you need. There is no practical problem using a
GtkTreeModel without a display. It's simply that gtk_init errors out if
there is no display, which is reasonable default behaviour. See the API
reference for details :)

Yours,
    Christian


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