Posible bug on action block_activate??



Hi.

I'm trying to block the activate signal from a Gtk::ToggleAction and afther some test, I come to this conclusion:

This code seem that doesn't work, the action is not blocked
Glib::RefPtr<Gtk::ToggleAction> m_action;
....
m_action = Gtk::ToggleAction::create("Enable", _("Enabled"));
m_action_group->add(m_action, sigc::mem_fun(*this, &MyClass::onActionEnabled));
...
m_action->block_activate();
m_action->set_active(some_value);
m_action->unblock_activate();

This code does the job:
Glib::RefPtr<Gtk::ToggleAction> m_action;
sigc::connection m_conn_enabled;
....
m_action = Gtk::ToggleAction::create("Enable", _("Enabled"));
m_conn_enabled = m_action->signal_activate().connect(sigc::mem_fun(*this, &CMyClass::onActionEnabled) );
m_action_group->add(m_action);
...
m_conn_enabled.block();
m_action->set_active(some_value);
m_conn_enabled.unblock();

So, probably there is a bug on block_activate( ) / unblock_activate().

Greetings
jamf

--
Atentamente:
Juan Ángel Moreno Fernández
------------------------------
  Gelide Frontend
  http://gelide.sf.net
------------------------------


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