Re: Gtk::Actionable Gtk::RadioToolButton?




Den 2014-07-31 00:04, Marc Singer skrev:

I'm using gtkmm to build a UI. The task I'm trying to accomplish is constructing a radio button from an action that is already part of a menu and a toolbar. I'd like the new button to proxy for the existing action.

One likely candidate is Gtk::Action::create_tool_item(). Its documentation states:

Deprecated: 3.10: Use a Gtk::ToolItem and associate it with a Action using Gtk::Actionable::set_action_name() instead

So, I'd expect that ToolItem and by inheritance RadioToolButton would implment this interface. In gtkmm-3.12 it does not and the stable documentation reflects this as well.

However, the C library gtk-3.0 RadioToolButton does implement this interface. So, my question is this.

Should gtkmm Gtk::RadioToolButton implement Gtk::Actionable? Is the absence of this int erface an oversight, or is there another way that the features of Actionable are supported?

The file toolbutton.hg contains this comment:
//TODO: Derive from (and implement) Actionable when we can break ABI.

The Actionable interface is new in gtk+ 3.4 and gtkmm 3.4. Gtk+ can add interfaces without breaking ABI (application binary interface). Gtkmm can't.
The next ABI break will be when gtk+ 4.0 and gtkmm 4.0 are released. I don't know when that will be.

There is a function, set_related_action() which associates the correct icon for the radio button. It doesn't seem to put the button into the group and it is also deprecated.

I tried this, and found that the button wasn't added to the action_group and the icon didn't appear.

 auto tool = Gtk::manage (new Gtk::RadioToolButton ());
 gtk_actionable_set_action_name (GTK_ACTIONABLE (tool->gobj ()), "sample-radio-action");

What am I missing? 




_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]