/* gcc -o gtkallocation -g gtkallocation.c $(pkg-config --cflags --libs gtk+-3.0) */

#include <gtk/gtk.h>

gint
main (gint argc, gchar *argv[])
{
  GtkWidget *window;
  GdkGeometry geometry;
  GdkWindowHints  mask;

  gtk_init (NULL, NULL);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_realize (window);

  mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
  geometry.min_width = 300;
  geometry.min_height = 1;
  geometry.max_width = 300;
  geometry.max_height = 300;
  gdk_window_set_geometry_hints (gtk_widget_get_window(window), &geometry, mask);
  gtk_window_maximize (GTK_WINDOW(window));

  g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
  g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
  gtk_widget_show_all (window);
  gtk_main ();

  return 0;
}
