Re: casting Gtk::UIManager::get_widget()





Paul Davis wrote:
Sergio,

The reason you're getting errors is because the widget being returned
isn't a CheckButton, its a CheckMenuItem or CheckMenuElem or
something.
> When doing things like this, I work with the actions
though. Something like this:

Glib::RefPtr< Gtk::Action > act = _ui_manager->get_action( actionName ) ;
Glib::RefPtr< Gtk::ToggleAction > tact =
               Glib::RefPtr< Gtk::ToggleAction >::cast_dynamic( act ) ;

if( tact->get_active() )
{
   //do something
}


It works! Thanks a lot.

HTH,
Paul Davis

s.



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