On Sat, 2005-11-26 at 13:33 +0000, John Cupitt wrote:
> 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

That sounds pretty cool!

Only it doesn't seem to work for me?
I even tried gtk_rc_parse_string("gtk-can-change-accels = 1");

Perhaps it's because I have a manually constructed menu?
Do you know if it only works with UI manager?

Thanks again!
-- 
Daniel Pekelharing
<[EMAIL PROTECTED]>

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to