Commit 33d409d9 authored by Matthias Clasen's avatar Matthias Clasen

Add an example for subtitles in header bars

parent 3731a2bd
......@@ -36,6 +36,21 @@ change_title (GtkButton *button, gpointer data)
static void
change_subtitle (GtkButton *button, gpointer data)
GtkWidget *headerbar = GTK_WIDGET (data);
if (gtk_header_bar_get_subtitle (GTK_HEADER_BAR (headerbar)) == NULL)
gtk_header_bar_set_subtitle (GTK_HEADER_BAR (headerbar), "(subtle subtitle)");
gtk_header_bar_set_subtitle (GTK_HEADER_BAR (headerbar), NULL);
main (int argc, char *argv[])
......@@ -76,7 +91,9 @@ main (int argc, char *argv[])
g_signal_connect (button, "clicked", G_CALLBACK (change_title), footer);
gtk_header_bar_pack_start (GTK_HEADER_BAR (footer), button);
gtk_header_bar_set_custom_title (GTK_HEADER_BAR (footer), gtk_check_button_new_with_label ("Middle"));
gtk_header_bar_pack_end (GTK_HEADER_BAR (footer), gtk_button_new_with_label ("End 1"));
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"));
gtk_box_pack_end (GTK_BOX (box), footer, FALSE, FALSE, 0);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment