Re: [Gtk-osx-users] Glade doesn't allow changing og accel keys

On Jun 9, 2011, at 4:26 AM, Dwayne Bailey wrote:

> On 2011-06-08 02:21, John Ralls wrote:
>> On Jun 7, 2011, at 4:54 PM, Richard Procter wrote:
>>> Hi Dwayne,
>>> On 7/06/2011, at 4:49 PM, Dwayne Bailey wrote:
>>>> I was wondering if anyone had had experience overriding accel_path
>>>> mapping in glade files?
>>> My understanding is that glade keybinding definitions are implemented in the lower level (?) AccelGroup mechanism, not the AccelMap.
>>> This bit me when implementing an automatic translation of my application's keybindings for OS X: AccelGroups keep their key->callback mapping private as far as I can tell.
>> Are you guys sure you're not confusing Accelerators (for menus) with Bindings (for buttons and other stuff)?
>> Accelerators are customized with AccelMaps -- regardless of whether they're created in directly in code or with GtkBuilder and xml files. Bindings are customized with gtkrc files.
> I'm pretty sure we talking about accelerators i.e. Ctrl+O to open a 
> file, Ctrl+S to save, etc.  The common theme as I write this is that 
> they are all stock items.
> The ones that are created in code can be changed with an accelmap, the 
> stock ones can't.  Perhaps the AccelGroup is the clue.  Or perhaps Stock 
> items are changed using the Binding mechanism?

OK, so you're on accelerators. Good.

The problem isn't stock menu items, but it may be that you're using an older version of Glade (before 3.6) which uses libglade, then it rolls its own accelerator keys in code, emitting the appropriate signal on its own. The solution is to upgrade to a more recent Glade (3.6 came out in 2009) and use GtkBuilder to load the UI files, associating them with action groups. Once that's done accel_map_save() will report all of the accelerators you've defined in Glade.

John Ralls

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