#include <gtk/gtk.h>

void
show_dialog (GtkButton *btn,
	     gpointer   user_data)
{
  GtkWidget *dialog;
  GtkWidget *header;

  dialog = gtk_dialog_new ();
  header = gtk_header_bar_new ();
  gtk_header_bar_set_title (GTK_HEADER_BAR (header), "Big title");
  gtk_header_bar_set_subtitle (GTK_HEADER_BAR (header), "Tiny title");
  gtk_window_set_titlebar (GTK_WINDOW (dialog), header);

  gtk_container_add (
      GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
      gtk_button_new_with_label ("Close me"));

  /*comment uncomment */
  gtk_window_set_transient_for (GTK_WINDOW (dialog),
				GTK_WINDOW (user_data));

  gtk_widget_show_all (dialog);
  gtk_dialog_run (GTK_DIALOG (dialog));
}

int
main (int    argc,
      char **argv)
{
  GtkWidget *window;
  GtkWidget *btn;

  gtk_init (&argc, &argv);
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
  gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);

  btn = gtk_button_new_with_label ("Launch");
  g_signal_connect (btn, "clicked", G_CALLBACK (show_dialog), window);

  gtk_container_add (GTK_CONTAINER (window), btn);

  gtk_widget_show_all (window);

  gtk_main ();
  return 0;
}
