[Glade-users] Underline in Gtk Actions



On Oct 17, 2009, at 1:51 PM, Tristan Van Berkom wrote:

On Sat, Oct 17, 2009 at 1:14 PM, Jonathan Lane <lanej at horizon.com>  
wrote:
I have a few GtkActions tied to toolbar buttons and menu items.  In
the menu items, how do I get underlined characters in the label?

For instance, if the Label of the GtkAction is "_Log Output", it
simply displays the underscore before the 'L'.  If in the menu item I
uncheck "Use action appearance" and specify the label there (and  
check
"Use Underline"), it will show correctly in the glade project, but  
not
in the program.

What is the correct procedure to achieve this?

Thats a good question - I have to check - its also possible that its
a bug or unimplemented in GTK+ (I think that there is already a bug  
with
menu items not rendering the accelerator indicator for accelerators  
specified
via actions).

Out of curiosity, the "use-underline" property is disabled in Glade  
with
"use-action-appearance" ?

Yes, the property is disabled if you select Use Action Appearance.  I  
was saying that I tried unchecking "Use Action Appearance" and  
manually setting the label in the menu item and it still didn't draw  
the underline.

Maybe "use-underline" needs just to be explicitly set - and will use
the "label" or "short-label" property of the action and render the
mnemonic underline (if its impossible with Glade, try it once by
hand in the xml with GtkBuilder, if it works then its an easy to
fix bug in Glade).

Ah, that does work.  Yay for easy bugs :)

-j




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