d47081
(D47081)
1
Trying to create new button disabled by default (on construct) but it’s still clickable, maybe that’s because of set_action_name
.
Is any ideas how to make it disabled?
// class Forward : public Gtk::Button
Forward::Forward()
{
set_action_name(
"win.tab_history_forward"
);
set_sensitive(
false // no effect
);
}
Hi,
Yes, I think when using an action, then the button sensitivity follows the action status.
Is it a GioSimpleAction? if yes, try using Gio.SimpleAction.set_enabled
1 Like
d47081
(D47081)
3
Yes, forgot about this action method, should work.
Thank you
d47081
(D47081)
4
Interesting, can I toggle this action status by the name?
For example:
get_action_by_name("win.tab_history_forward")->set_enabled(false);
system
(system)
Closed
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.