diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-05-12 21:00:06 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-05-12 21:01:59 -0400 |
commit | 8fcfbc179c5741104a725dc2161d9a6c5bdd5350 (patch) | |
tree | 95a5be72a6a1ae7cbfccdfe837f3bdded8fb3fdc /tests/testheaderbar.c | |
parent | 7052d4071cff1bbbebb58b867e364a231e4dc841 (diff) | |
download | gtk+-8fcfbc179c5741104a725dc2161d9a6c5bdd5350.tar.gz |
Test a few more titlebar things
Add tests for fullscreening and disposing with custom titlebar
to testheaderbar.
Diffstat (limited to 'tests/testheaderbar.c')
-rw-r--r-- | tests/testheaderbar.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/testheaderbar.c b/tests/testheaderbar.c index cfee8d43f3..18b2b42a46 100644 --- a/tests/testheaderbar.c +++ b/tests/testheaderbar.c @@ -51,6 +51,24 @@ change_subtitle (GtkButton *button, gpointer data) } } +static void +toggle_fullscreen (GtkButton *button, gpointer data) +{ + GtkWidget *window = GTK_WIDGET (data); + static gboolean fullscreen = FALSE; + + if (fullscreen) + { + gtk_window_unfullscreen (GTK_WINDOW (window)); + fullscreen = FALSE; + } + else + { + gtk_window_fullscreen (GTK_WINDOW (window)); + fullscreen = TRUE; + } +} + int main (int argc, char *argv[]) { @@ -102,7 +120,9 @@ main (int argc, char *argv[]) button = gtk_button_new_with_label ("End 1"); g_signal_connect (button, "clicked", G_CALLBACK (change_subtitle), header); gtk_header_bar_pack_end (GTK_HEADER_BAR (footer), button); - gtk_header_bar_pack_end (GTK_HEADER_BAR (footer), gtk_button_new_with_label ("End 2")); + button = gtk_button_new_with_label ("End 2"); + gtk_header_bar_pack_end (GTK_HEADER_BAR (footer), button); + g_signal_connect (button, "clicked", G_CALLBACK (toggle_fullscreen), window); gtk_box_pack_end (GTK_BOX (box), footer, FALSE, FALSE, 0); content = gtk_image_new_from_icon_name ("start-here-symbolic", GTK_ICON_SIZE_DIALOG); @@ -114,5 +134,7 @@ main (int argc, char *argv[]) gtk_main (); + gtk_widget_destroy (window); + return 0; } |