/*
 ============================================================================
 Name        : gtk2Testing.c
 Author      : Leo
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style
 ===========================================================================
 */

#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>

int main( int   argc,
          char *argv[] )
{
    //------------------ INIT
	GtkWidget *window;
	GtkWidget *grid;
	GtkWidget *button;
	GtkCalendar *calendar;

    gtk_init (&argc, &argv);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title (GTK_WINDOW (window), "GtkCalendar GTK3");
    gtk_window_set_default_size(window, 300, 350);
    gtk_container_set_border_width (GTK_CONTAINER (window), 5);

    //--- Vertical Layout:
    grid = gtk_grid_new ();
    gtk_container_add (GTK_CONTAINER (window), grid);

    //------------------ ADD ELEMENTS
    calendar=gtk_calendar_new ();
//  gtk_widget_set_valign (calendar, GTK_ALIGN_CENTER); //This is the fix.
    gtk_grid_attach (GTK_GRID (grid), calendar, 0, 0, 1, 10);

    int i;
    for (i = 0; i < 11; i++) {
		button = gtk_button_new_with_label ("Button");
		gtk_grid_attach (GTK_GRID (grid), button, 1, i, 1, 1);
    }

    //------------------ POST LOOP
    gtk_widget_show_all (window);
    gtk_main ();

    return 0;
}
