Skip to content

Instantly share code, notes, and snippets.

@ebassi
Last active February 21, 2019 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebassi/64fd91a8936a5d87355581acbf8ff931 to your computer and use it in GitHub Desktop.
Save ebassi/64fd91a8936a5d87355581acbf8ff931 to your computer and use it in GitHub Desktop.

In Menu Bar 1 (constructed using Gio::Menu): How can one add tooltips? How can one give a CSS class or id to a widget?

  • Menus constructed with GMenu do not have tooltips; we find that tooltips are generally problematic in menu context due to how tooltips and menus are implemented using similar windowing system constructs that end up competing for event handling and stacking. Additionally, menus constructed with GMenu could be sent over some IPC mechanism, to other entities, like the compositor, which may or may not have the concept of "tooltip".
  • Menus constructed with GMenu do not have CSS style information. Like with tooltips, menus could be displayed by something that is not the application, which means style information is not transferrable.

We could have additional fields for descriptions of a menu, but the interpretation of that description would be left to the discretion of the toolkit, platform, or windowing system.

In Menu Bar 2 (constructed using GtkMenu): Why do Test 3 and Test 4 fail to trigger action? (They do update when using another GUI element changes the selected value.) How do you add accelerators (keyboard shortcuts)? (Gtk-Critical using )

I'm having trouble parsing the C++ code, so you may need to write a minimal C example that exhibits the same behaviour and file an issue.

If there's a Critical warning when parsing a valid UI description, you should file a bug against GTK.

In both menu bars: Why do you need to click Test 1, etc. twice to trigger action?

I have no idea. :-)

In CSS file, why doesn't 'checkmenuitem' or 'radiomenuitem' work as an element selector?

There's no "checkmenuitem" selector; it's menuitem check.

Same for "radiomenuitem": the selector is menuitem radio.

How can one use custom widgets in .ui files (i.e. MyWidget : public Gtk::Label).

This is a gtkmm issue, I think.

@Tavmjong
Copy link

Thanks for your answers!

It would be useful to have additional description fields for menus for windowing systems that support tooltips and styling (I imagine a "description" field could be useful even if a system doesn't support tooltips).

I've uploaded a illustrates GTK+ that shows my problem of trying to get GActions working with a menubar constructed using GtkMenu (in the directory "gtk_action").

I've also added to the README of the directory "gtkmm_paned" instructions on how to reproduce the failed drag-and-drop under X11 that works with Wayland.

My test repository is at https://gitlab.com/Tavmjong/gtk_sandbox/tree/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment