#include <gtk/gtk.h>


static gboolean delete_event( GtkWidget *widget,
                              GdkEvent  *event,
                              gpointer   data )
{
    gtk_main_quit ();
}

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

    gtk_init (&argc, &argv);
    
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    
    g_signal_connect (window, "delete-event",
		      G_CALLBACK (delete_event), NULL);

    frame = gtk_frame_new (NULL);
    
    gtk_container_add (GTK_CONTAINER (window), frame);
    gtk_widget_show (frame);

    box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
    /* Or this if using GTK+ 2:
    box = gtk_vbox_new (FALSE, 6);
    */

    gtk_container_add (GTK_CONTAINER (frame), box);
    gtk_widget_show (box);

    int i = 0;
    for (i = 0; i < 4; ++i)
    {
      GtkWidget* button = gtk_button_new_with_label("test yadda yadda");
      gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
      gtk_widget_show (button);
    }

    label = gtk_label_new("test label");
    gtk_frame_set_label_widget (GTK_FRAME (frame), label);

    /* Without this call, the size allocation seems to be wrong,
       so the last button is cut in half horizontally, because the window is not big enough:
       gtk_widget_show (label);
     */
    
    gtk_widget_show (window);

    gtk_main ();
    
    return 0;
}
