#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>

int gtk_activate (GtkWidget* widget, gpointer data) {
	printf ("Selection %s\n", data);
}

int main (int argc, char** argv) {
	GtkWidget *shellHandle, *vboxHandle, *button1Handle, *button2Handle;
	GtkAccelGroup *accelGroup;
	
	gtk_init_check (&argc, &argv);
	shellHandle = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	vboxHandle = gtk_vbox_new (FALSE, 2);
	button1Handle  = gtk_button_new_with_label ("Button1");
	button2Handle  = gtk_button_new_with_label ("Button2");

	g_signal_connect (G_OBJECT (shellHandle), "destroy", G_CALLBACK (gtk_main_quit), NULL);
	g_signal_connect (G_OBJECT (shellHandle), "delete_event",G_CALLBACK (gtk_main_quit), NULL);
	g_signal_connect (G_OBJECT (button1Handle), "activate",G_CALLBACK (gtk_activate), "Button1");
	g_signal_connect (G_OBJECT (button2Handle), "activate",G_CALLBACK (gtk_activate), "Button2");

	
	gtk_container_add (GTK_CONTAINER (shellHandle), vboxHandle);
	gtk_container_add (GTK_CONTAINER (vboxHandle), button1Handle);
	gtk_container_add (GTK_CONTAINER (vboxHandle), button2Handle);

	accelGroup = gtk_accel_group_new ();
	gtk_window_add_accel_group (GTK_WINDOW(shellHandle), accelGroup);
	gtk_widget_add_accelerator (button1Handle, "activate", accelGroup, GDK_F1, 0, GTK_ACCEL_VISIBLE); //Works
	gtk_widget_add_accelerator (button2Handle, "activate", accelGroup, GDK_F1, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); //BAD
	gtk_widget_add_accelerator (button2Handle, "activate", accelGroup, GDK_F2, 0, GTK_ACCEL_VISIBLE); //backup acc
	
	
	gtk_window_set_default_size (GTK_WINDOW (shellHandle), 280, 250);
	gtk_widget_show_all (shellHandle);
	gtk_main();
}
