Re: GtkApplication and argc/arv



On Mon, Feb 21, 2011 at 3:57 PM, Murray Cumming <murrayc murrayc com> wrote:
> I'm trying to wrap GtkApplication for gtkmm but I can't really do that
> until I understand how it's meant to be used.
>
> In general, I find the documentation lacks overview and advice, partly
> because it's spread between GApplication and GtkApplication and mentions
> some concepts without explaining them first.

Yeah, it's an issue.

> 1.
> Are we still meant to call gtk_init(&argc, &argv) when using
> GtkApplication, which takes argc/argv again via g_application_run(). Or
> is gtk_init() then superfluous?

gtk_init is superfluous, yes; it's handled in the startup phase of
GtkApplication.

> Mathias mentioned that gtk_init(NULL, NULL) is best anyway, though I
> don't understand why:
>  http://bugzilla.gnome.org/show_bug.cgi?id=639925#c3

It doesn't really do anything interesting or useful; you can achieve everything
with environment variables

> 2.
> How should we use GOptionContext to parse command line arguments from
> argc/argv when using GtkApplication. Is this the ideal way, using the
> command-line signal?
>  http://git.gnome.org/browse/totem/tree/src/totem.c#n187
> It seems a little long-winded.

I think that's best practice, yeah.  It's obviously complicated, but I
don't think it could really be made much easier.  Be happy to be
proved wrong though =)


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