Improve GtkApplication migration guide
As pointed out in bug 641517, the examples did not actually do the same.
This commit is contained in:
@ -59,11 +59,21 @@ The same application using GtkApplication:
|
|||||||
static void
|
static void
|
||||||
activate (GtkApplication *app)
|
activate (GtkApplication *app)
|
||||||
{
|
{
|
||||||
|
GList *list;
|
||||||
GtkWidget *window;
|
GtkWidget *window;
|
||||||
|
|
||||||
window = create_my_window ();
|
list = gtk_application_get_windows (app);
|
||||||
gtk_window_set_application (GTK_WINDOW (window), app);
|
|
||||||
gtk_widget_show (window);
|
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
|
int
|
||||||
|
|||||||
Reference in New Issue
Block a user