[gtkada] Underlined menu shortcuts

Larry Elmore ljelmore at home.com
Tue May 15 06:39:47 CEST 2001


I'm in the process of learning GtkAda, and have been using Glade. I've
had no problem figuring out keyboard accelerators such as CTRL-O for
'Open' and having those displayed in the menus. However, I can't figure
out how to get underlined accelerators to work or display. The code gate
generates shows menu items as "_Open" instead of with an underlined 'O'.
I know how to get this to work in C using gtk_label_parse_uline(), and
have looked at the source for Gtk.Label.Parse_Uline(), but can't get my
code past the compiler. This call is not used in anything in the GtkAda
examples/ or testgtk/, and I was wondering if anyone else has ever used
this in GtkAda? It's not exactly a vital function, but I know when I'm
learning a program and don't yet know all the "real" keyboard shortcuts,
it's nice to be able to work the menus without having to take my hand
away from the keyboard, and I'm sure I'm not alone in this. 

The following is a piece of what gate generates:

   Gtk_New (Window1.Kon_Tiki1, "_KonTiki");
   Set_Right_Justify (Window1.Kon_Tiki1, False);
   Add (Window1.Menubar1, Window1.Kon_Tiki1);

Can I make a call to Gtk.Label.Parse_Uline() with an appropriate cast
following the Gtk_New() and if so, what's the correct cast? Or is it a
good deal more complicated, as I suspect? Any hintss would be much
appreciated!

Larry




More information about the gtkada mailing list