forked from AuroraMiddleware/gtk
migrating-unique-GtkApplication: Update to new GApplication api
This commit is contained in:
parent
71f6b2d40a
commit
c1f44c0f83
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<example><title>A unique application</title>
|
<example><title>A unique application</title>
|
||||||
<para>Here is a simple application using libunique:
|
<para>Here is a simple application using libunique:
|
||||||
<programlisting>
|
<informalexample><programlisting>
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -53,9 +53,9 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting></informalexample>
|
||||||
The same application using GtkApplication:
|
The same application using GtkApplication:
|
||||||
<programlisting>
|
<informalexample><programlisting>
|
||||||
static void
|
static void
|
||||||
activate (GtkApplication *app)
|
activate (GtkApplication *app)
|
||||||
{
|
{
|
||||||
@ -85,13 +85,13 @@ main (int argc, char *argv[])
|
|||||||
app = gtk_application_new ("org.gtk.TestApplication", 0);
|
app = gtk_application_new ("org.gtk.TestApplication", 0);
|
||||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||||
|
|
||||||
status = g_application_run (app);
|
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||||
|
|
||||||
g_object_unref (app);
|
g_object_unref (app);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting></informalexample>
|
||||||
</para>
|
</para>
|
||||||
</example>
|
</example>
|
||||||
<section><title>Uniqueness</title>
|
<section><title>Uniqueness</title>
|
||||||
|
Loading…
Reference in New Issue
Block a user