/*  gcc -g -Wall -O2 -o dialog-test dialog-test.c `pkg-config --cflags --libs gtk+-3.0` */
#include <gtk/gtk.h>

int main(int argc, char **argv)
{
  GtkWidget *dialog;
  GtkWidget *label;

  gtk_init (&argc, &argv);

  dialog = gtk_dialog_new_with_buttons(NULL, NULL, 0,
                                       GTK_STOCK_OK, GTK_RESPONSE_OK,
                                       NULL);
  /*
   * If this is omitted, the dialog ends up with a bunch of blank space
   * in its minimum size. Why????????
   */
  gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);

  label = gtk_label_new ("Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
                         "Nulla innn urna ac dui malesuada ornare. Nullam dictum "
                         "tempor mi et tincidunt. Aliquam metus nulla, auctor "
                         "vitae pulvinar nec, egestas at mi. Class aptent taciti "
                         "sociosqu ad litora torquent per conubia nostra, per "
                         "inceptos himenaeos. Aliquam sagittis, tellus congue "
                         "cursus congue, diam massa mollis enim, sit amet gravida "
                         "magna turpis egestas sapien. Aenean vel molestie nunc. "
                         "In hac habitasse platea dictumst. Suspendisse lacinia"
                         "mi eu ipsum vestibulum in venenatis enim commodo. "
                         "Vivamus non malesuada ligula.");

  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);

  /* You can influence the width of the dialog using either of the following,
   * but if both are omitted, things are still reasonable, *as long as the
   * dialog is not resizable*. When the dialog is resizable, then these
   * slightly improve things from very very broken to just very broken in terms
   * of the amount of left-over white space there is.
   */

  /* gtk_label_set_width_chars (GTK_LABEL (label), 60); */
  /* gtk_widget_set_size_request (GTK_WIDGET (dialog), 500, -1); */

  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
                      label, 0, TRUE, TRUE);
  gtk_widget_show (label);

  gtk_dialog_run (GTK_DIALOG (dialog));

  return 0;
}
