- From: Havoc Pennington <hp pobox com>
- To: Matthias Clasen <matthias clasen gmail com>
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: GtkApplication
- Date: Fri, 11 Jun 2010 10:19:36 -0400
On Fri, Jun 4, 2010 at 12:50 PM, Matthias Clasen
<matthias clasen gmail com> wrote:
> app = g_object_new (GTK_TYPE_APPLICATION, "appid", appid, NULL);
> g_application_register (app, argc, argv, gtk_application_get_platform_data ());
A convenience API that took the likely parameters and initialized a
global singleton would be nice.
gtk_application_init("org.foo.Bar", argc, argv);
To do special/extra stuff you could either do:
application = gtk_application_get()
or you could create the application yourself if you wanted to have two
of them or something.
There might also be some more elaborate convenience functions, such as
init_with_builder() or something, not sure what is right, but at least
one that did all "recommended stuff for a typical app"
Anyway it'd be nice to avoid a bunch of boilerplate that every app has
to type in.
As mentioned on the bug I kinda like the convenience API to allow a
callback which handles both first launch and subsequent activations.
] [Thread Prev