[gtkada] Underlined menu shortcuts

Preben Randhol randhol at pvv.org
Tue May 15 11:27:33 CEST 2001


Larry Elmore <ljelmore at home.com> wrote on 15/05/2001 (09:59) :
> 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!

The problem is if you do:

   Gtk_New (Window1.Kon_Tiki1, -"_KonTiki");

That is if you use the locales. Ok KonTiki is a boat so it would be the
same in most languages, but say it was Open. In Norwegian it is Åpne, so
you need some system for setting the underscore at the right place, but
you also need to use the right letter for the signal... If you look at
the Gtk.Menu it says:

   function Get_Uline_Accel_Group
        (Menu               : access Gtk_Menu_Record)
         return Accel_Group.Gtk_Accel_Group;

   Get the accelerator group that is used internally by the menu for
   underline accelerators while the menu is popped up.

-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 «For me, Ada95 puts back the joy in programming.»




More information about the gtkada mailing list