How to drag the button to change position in GTK4.0?

There is no “motion_notify event” anymore?
How to implement using mouse to drag the widget?
I’m using gtkmm4.0.

Hi,

In Gtk4 input handling has switched to event controllers. You will likely want to use Gtk::GestureDrag and its three signals. All you need to do is create the object, connect the signals, and then add it to your widget with add_controller.

1 Like

Thanks, gotcha!
And How to draw in the “snapshot_vfunc”?

You can read the description of the drawing model in the API reference.

1 Like

Thank you! I’m rookie in GTK…
I find the gtkmm is the newest version and choose to use.
although valac is codeless, but the doc is old./(ㄒoㄒ)/~~

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