Re: Signal on mouse over menu item?



On 11/26/05, Daniel Pekelharing <legendstar gmail com> wrote:
I'm trying to implement a system for making the accelerators adjustable
in a easy way. I'm working on a 3D Animation app, and I've picked up
(from forums and such) that 3D designers are rather particular about
having flexibility on keyboard shortcuts...

Ah, OK, you're in luck, GTK has a very nice system like this already built in.

Just add

  gtk-can-change-accels = 1

To your .gtkrc and all your gtk applications will have programmable
accelerators. You select the menu item you want to set an accelerator
for, press CTRL-SHIFT-K or whatever, and that combination is now bound
to that action. It updates the menu item text to show the shortcut,
and removes that shortcut from any other menu items which also have
that set.

You'll need to be able to load and save your edited shortcuts: see
gtk_accel_map_load() and gtk_accel_map_save(). I'd like a
reset-to-defaults call, but I've never found it :-(

Rather than asking people to edit their .gtkrc, I have the
gtk-can-change-accels line in my application's resource file, which I
think is frowned on. Oh well.

John



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