Re: casting Gtk::UIManager::get_widget()
- From: Sergio Perticone <g4ll0ws gmail com>
- To: gtkmm mailing-list <gtkmm-list gnome org>
- Subject: Re: casting Gtk::UIManager::get_widget()
- Date: Sat, 28 Apr 2007 21:14:12 +0200
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]