Re: gtk-devel-list Digest, Vol 166, Issue 9





On 8 February 2018 at 12:01, <gtk-devel-list-request gnome org> wrote:
Message: 2
Date: Wed, 07 Feb 2018 13:45:47 +0100
From: Christian Schoenebeck <schoenebeck linuxsampler org>
To: gtk-devel-list gnome org
Subject: gtk_menu_item_set_accel_path()
Message-ID: <1582692.dYf0dnMCMj@silver>
Content-Type: text/plain; charset="us-ascii"

Hi!

I am currently debugging gtk_menu_item_set_accel_path():  when using that
function then keyboard accelerator key(s) are not displayed in the menu item
at all. Has anybody looked into this bug before?

What I found out so far is that the the menu item's

        GtkAccelLabel->priv->accel_string

        and

        GtkAccelLabel->priv->accel_string_width

are correctly updated with the expected textual representation of the keyboard
accelerator key(s) (i.e. "Ctrl c", "F1", etc.), however the menu item's
GtkAccelLabel would never be displayed on screen.

I think we'd need to see precisely how you're setting up this MenuItem to do anything other than speculate wildly.

But note that the doc description indicates you're expected to set the accel shown yourself, rather than that the MenuItem will automatically show one if it's available:

https://developer.gnome.org/gtk3/stable/GtkMenuItem.html#GtkMenuItem.description

I see no indication in gtkmenuitem.c that it ever manages the displayed accelerator for the user.

If you're using some other means of creating MenuItems, we need to know what that is, to say whether or not that method should be doing this for you automatically.

 
Also the menu item's size is not updated either. By default, when displaying a
menu item without any action/accelerator, the size (more specific: its width)
of the menu item is limited to the menu item's main text label. And when an
action with keyboard accelerator is assigned to the menu item, the size of the
menu item is enlarged to display the acceleration label as well. The latter
never happens when using gtk_menu_item_set_accel_path().

Isn't this a tautology? Why would the size be updated for an accelerator that is not being shown...?


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