Underline in Gtk Actions

View: New views
3 Messages — Rating Filter:   Alert me  

Underline in Gtk Actions

by Jonathan Lane :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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?

-Jonathan
_______________________________________________
Glade-users maillist  -  Glade-users@...
http://lists.ximian.com/mailman/listinfo/glade-users

Re: Underline in Gtk Actions

by Tristan Van Berkom-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Oct 17, 2009 at 1:14 PM, Jonathan Lane <lanej@...> 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" ?

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).

Cheers,
         -Tristan
_______________________________________________
Glade-users maillist  -  Glade-users@...
http://lists.ximian.com/mailman/listinfo/glade-users

Re: Underline in Gtk Actions

by Jonathan Lane :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

> On Sat, Oct 17, 2009 at 1:14 PM, Jonathan Lane <lanej@...>  
> 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
_______________________________________________
Glade-users maillist  -  Glade-users@...
http://lists.ximian.com/mailman/listinfo/glade-users