Re: Accelerators question




"Andrew A. Bely" <taurus@cave.garant.ru> writes:

> Hi, all!
> 
> The accelerators usage in Gtk+ is simple, but now
> I have a question: how can I use non-character keys
> like F1-F12, PgUp, Del, etc. as accelerators?
> Well, the hard way is to connect to "key_press_event"
> and do some "dirty" work; but using accelerators looks
> like better and simpliest way... Is it possible, and, if yes,
> how I can do it?

In GTK+-1.0, you can't - you'll need to attach to "key_press_event" on
the toplevel window. 

In GTK+-1.1, things like:

      gtk_widget_add_accelerator (menuitem,
				  "activate",
				  accel_group,
				  GDK_F1,
				  0,
				  GTK_ACCEL_VISIBLE | GTK_ACCEL_SIGNAL_VISIBLE);

work fine.

Regards,
                                        Owen



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