/*
 * gcc `pkg-config --libs --cflags gtk+-3.0` stack-in-list-box.c -o stack-in-list-box
 */

#include <gtk/gtk.h>

static void
row_activated_cb (GtkListBox *list,
                  GtkListBoxRow *row,
                  gpointer user_data)
{
  g_print ("row_activated_cb\n");
}

int
main (int   argc,
      char *argv[])
{
  GtkWidget *box;
  GtkWidget *label;
  GtkWidget *list_box;
  GtkWidget *window;

  gtk_init (&argc, &argv);

  label = gtk_label_new ("kala");
  gtk_widget_show (label);

#if 1
  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
#else
  box = gtk_stack_new ();
#endif
  gtk_container_add (GTK_CONTAINER (box), label);
  gtk_widget_show (box);

  list_box = gtk_list_box_new ();
  gtk_container_add (GTK_CONTAINER (list_box), box);
  gtk_widget_show (list_box);

  g_signal_connect (list_box, "row-activated",
                    G_CALLBACK (row_activated_cb), NULL);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_add (GTK_CONTAINER (window), list_box);
  gtk_widget_show (window);

  gtk_main ();

  return 0;
}
