gtk_widget_add_accelerator



Hi All,

I am trying to add an accelerator. Here's a sample
code:

GtkWidget *w=gtk_window_new(GTK_WINDOW_TOPLEVEL);
GtkWidget *e=gtk_button_new_from_stock(GTK_STOCK_OK);
GtkAccelGroup *gag = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(w),gag);
g_signal_connect(G_OBJECT(e),"clicked",G_CALLBACK(print),NULL);
guint mod = GDK_SHIFT_MASK;
mod |= GDK_CONTROL_MASK;
gtk_widget_add_accelerator(e,"clicked",gag,'6',GDK_CONTROL_MASK|GDK_SHIFT_MASK,GTK_ACCEL_VISIBLE);
gtk_container_add(GTK_CONTAINER(w),e);
gtk_widget_show(e);
gtk_widget_show(w);


When the application is run, Ctrl+6 calls the callback
but not Ctrl+Shift+6. Any idea what's going on here?
(I am using GTK 2.0.9)

Thanks
-Pramod




	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]