![]() |
Cadabra
Computer algebra system for field theory problems
|
A right-click context menu.
gtkmm-3 builds one from Gtk::Menu + Gtk::MenuItem and pops it up at the pointer. Both of those classes are gone in GTK4, where a menu is a Gio::Menu model whose items name actions, shown through a Gtk::PopoverMenu parented to the widget. This wrapper hides the difference so the call sites read the same on both.
#include <GtkCompat.hh>
Public Member Functions | |
| ContextMenu ()=default | |
| ContextMenu (const ContextMenu &)=delete | |
| ContextMenu & | operator= (const ContextMenu &)=delete |
| ~ContextMenu () | |
| void | attach_to (Gtk::Widget &widget, const Glib::ustring &action_prefix) |
| Call once, before add_item(). | |
| void | add_item (const Glib::ustring &label, const sigc::slot< void()> &callback) |
| void | popup_at (double x, double y) |
x, y are relative to the widget passed to attach_to(). | |
Private Attributes | |
| Gtk::Menu | menu |
|
default |
|
delete |
|
inline |
|
inline |
|
inline |
Call once, before add_item().
action_prefix only has to be unique within widget.
|
delete |
|
inline |
x, y are relative to the widget passed to attach_to().
|
private |