EventControllerFocus signal_leave() not emitted

Hi, I’m using gtkmm4, I need to implement a button that changes its image upon selection.
I created my own class which derives from Gtkmm::Button and holds 2 images: the “normal” and the “selected”. I want to switch the images in the focus in and focus out events.
I added an EventControllerFocus to my button and registered to signal_enter() and signal_leave() events.
Unfortunately I only get the signal_enter() event, not the signal_leave() enent
This is my code: (_controller is a member in my class)
_controller = Gtk::EventControllerFocus::create();
_connectionNormal = _controller->signal_enter().connect(sigc::bind(sigc::mem_fun(*this, &MultiImageButton::OnEnterFocus)));
_connectionSunk = _controller->signal_leave().connect(sigc::bind(sigc::mem_fun(*this, &MultiImageButton::OnLeaveFocus)));
add_controller(_controller);

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