#include <gtk/gtk.h>

static void activate_cb(GtkWidget *window, GtkWidget *frame) {
	GtkAllocation allocation;
	GtkRequisition requisition;

	gtk_widget_get_allocation(frame, &allocation);

	allocation.width = 1;
	printf("allocation size: %d x %d\n", allocation.width, allocation.height);
	gtk_widget_size_allocate(frame, &allocation);
}

static void destroy(GtkWidget *widget, gpointer data) {
	gtk_main_quit();
}

int main(int argc, char **argv) {

	GtkWidget *window;
	GtkWidget *frame;

	gtk_init(&argc, &argv);

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

	gtk_window_set_title(GTK_WINDOW(window), "Window");
	gtk_window_set_default_size(GTK_WINDOW(window), 200, 200);

	frame = gtk_frame_new("Frame");

	gtk_container_add(GTK_CONTAINER(window), frame);

	g_signal_connect(frame, "show", G_CALLBACK (activate_cb), frame);
	g_signal_connect(window, "destroy", G_CALLBACK (destroy), NULL);
	gtk_widget_show_all(window);

	gtk_main();

	return 0;
}
