Improve GtkApplication migration guide

As pointed out in bug 641517, the examples did not actually
do the same.
This commit is contained in:
Matthias Clasen 2011-02-04 21:21:14 -05:00
parent 3c1ff82b21
commit 2b2e607492

View File

@ -59,11 +59,21 @@ The same application using GtkApplication:
static void
activate (GtkApplication *app)
{
GList *list;
GtkWidget *window;
window = create_my_window ();
gtk_window_set_application (GTK_WINDOW (window), app);
gtk_widget_show (window);
list = gtk_application_get_windows (app);
if (list)
{
gtk_window_present (GTK_WINDOW (list->data));
}
else
{
window = create_my_window ();
gtk_window_set_application (GTK_WINDOW (window), app);
gtk_widget_show (window);
}
}
int