gksu-devel
[Top][All Lists]
Advanced

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

Re: gksu 1.1.0, new API


From: Gustavo Noronha Silva
Subject: Re: gksu 1.1.0, new API
Date: Mon, 2 Feb 2004 16:38:48 -0200

Em Sat, 31 Jan 2004 14:28:14 +0100, Filip Van Raemdonck <address@hidden> 
escreveu:

> Heya,

Heya!

> > It probably should. Applications that use GTK+ themselves can then use
> > gksu_init at the start; programs that don't can call it right before
> > calling other gksu_* calls.
> 
> I just realized that gksu_init is really only needed just for calling
> gtk_init in the new API, which does make it a bit superfluous to keep
> around.
> Furthermore, it requires two arguments but requires them _only_ to pass
> on; it doesn't need them itselve. This is annoying, as this makes the
> API slightly less clean for possible python bindings (and for any other
> language which can perform implicit module initalization upon loading).

Indeed.

> > Hmm, can gtk_init be called multiple times with no side effects?
> 
> I just checked it's source code, it looks like it can.

It can, libgksu 1.0.0 actually did that, as you can see, it will work even
if the program already uses gtk.

> Given that, I think it's safe to simply call gtk_init at the front of any
> gksu function that needs it. Note that we can pass it dummy arguments
> there; if gtk has already been initialized they'll be discarded and if it
> hasn't - indicating a non-GTK+ app - we shouldn't be passing special
> arguments to GTK+ anyway.

Doing that right now.

> > (just commenting on design, not functionality. I'll have to take a closer
> > look first)
> > Seems a bit awkward. Why aren't these methods on GksuContext instead of
> > plain gksu functions, if they all require a context to begin with?
> 
> To answer myself, because GksuContext isn't a GObject to begin with.
> I'll see how much work it is to implement that way.

I don't know if making GksuContext a GObject is needed. Would this
help on binding implementations? (mainly C++, Python and other
OO languages?).

[]s!

-- 
address@hidden: Gustavo Noronha <http://people.debian.org/~kov>
Debian:  <http://www.debian.org>  *  <http://www.debian-br.org>
  "Não deixe para amanhã, o WML que você pode traduzir hoje!"
        http://debian-br.alioth.debian.org/?id=WebWML




reply via email to

[Prev in Thread] Current Thread [Next in Thread]