[Allegro 5] How to list keyboard shortcuts in menu?


Is there a good way to add associated keyboard shortcuts to menu item captions, other than directly appending it to the caption? For example with wxWidgets, you can use \t to seperate/right-align part of the caption. Is there any equivalent of this in Allegro 5?

I know I can underline letters by prepending "&", but that's not what I want.

Todd Cope

There is currently no way to do this using the Allegro 5 API.


For Windows, it's as easy as adding the \t. I tried looking into how to do this for GTK, but it is not as obvious. Would have to see how wxWidgets does it.

EDIT: Looks like it is not too bad: https://github.com/wxWidgets/wxWidgets/blob/master/src/gtk/menu.cpp#L657


Ok, good to know, and thanks for the replies you two.

SiegeLord, it'd be great to have this available for GTK at some point. Already had a look at gtk_menu.c myself to see if I could do something about it, but unfortunately it's a bit beyond my current coding skills :o

Thread #616981. Printed from Allegro.cc