Re: How to make application menu items sensitive/insensitive?
- From: Phil Wolff <adiabat centurylink net>
- To: gtkmm-list gnome org
- Subject: Re: How to make application menu items sensitive/insensitive?
- Date: Sun, 13 Sep 2015 09:11:50 -0700
Gio::SimpleAction::set_enabled ( bool )
On 09/13/2015 09:07 AM, Gerardo Ballabio wrote:
Hello,
a few weeks ago I asked how to build a Gnome-3 style application menu
and got useful answers
(https://mail.gnome.org/archives/gtkmm-list/2015-August/msg00008.html). I
have now built an application menu into my program.
Now I'm trying to proceed further. I need to turn on and off specific
menu items. For example say I have two items "New Game" and "Stop
Game" (see attached example). When you are already playing "New Item"
should be insensitive and "Stop Game" should be sensitive. When you
aren't playing it should be the opposite.
In gtkmm 2, each menu item was connected to a Gtk::Action, and that
class has a set_sensitive() method. But in gtkmm 3, at least in the
examples that I was shown, actions are added via
Gtk::ApplicationWindow::add_action() or Gtk::Application::add_action()
(both inherited from Gio::ActionMap), those actions are
Gio::SimpleAction, and that class doesn't seem to have a
set_sensitive() equivalent.
Can you please help me?
Thanks in advance
Gerardo
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list
--
Just remember, if we get caught, you're deaf and I don't speak English.
-- Unknown
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]