How do you assign popup-like function to other widgets?

I’m trying to have a slider that works as a popup when you press somewhere. It pops up the same way as a Gtk::Menu and if you click outside it’s area it closes. I haven’t found any way to do this in Gtk.

I tried creating a Gtk;:Menu, with a Gtk::MenuItem inside and then put a Gtk::HScale inside the menuitem via add.

This works and has the desired behavior, but the HScale is completely insensitive to mouse input. Can this be fixed?

If not, is there another way one can make something with Gtk::Menu popup-like behavior? And that It has very useful functions such as Gtk::Menu::popup_at_rect() or hiding when clicking outside the area.

Do you mean like GtkScaleButton?

https://developer.gnome.org/gtk3/stable/GtkScaleButton.html

I suggest using a GtkPopover, which acts like a GtkMenu:

https://developer.gnome.org/gtk3/stable/GtkPopover.html

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.