forked from AuroraMiddleware/gtk
Improve GtkApplication migration guide
As pointed out in bug 641517, the examples did not actually do the same.
This commit is contained in:
parent
3c1ff82b21
commit
2b2e607492
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user