I'm trying to get the cursor's coordinates and what type of click occurred when clicking on a button in gtkmm 4.0.
In gtkmm 3.0, I could use GdkEventButton
, as in this example from the docs:
bool on_button_press(GdkEventButton* event);
Gtk::Button button("label");
button.signal_button_press_event().connect( sigc::ptr_fun(&on_button_press) );
But GdkEventButton
seems to no longer exist or no longer be accessible in gtkmm 4.0.
There is a reference to GdkEvent API changes in the migration documentation, but I still do not understand how to migrate that example code.
I've made a few unsuccessful blind attempts that probably aren't helpful to reproduce here (e.g. swapping out GdkEventButton
with GdkEvent
in the example). Is anyone more familiar or has any sort of related example? Thanks!