casting Gtk::UIManager::get_widget()



Hi,
I've a menu with a checkbutton, how can I check if is it active?

I've tried this way:

void Window::f()
{
Gtk::CheckButton* pCheck = static_cast<Gtk::CheckButton*>(refUIManager->get_widget("/Where/Is/CheckButton"));

	if(pCheck && pCheck->get_active()) {
	       // ...
	}
}

But at runtime I get this message:
Gtk-CRITICAL **: gtk_toggle_button_get_active: assertion `GTK_IS_TOGGLE_BUTTON (toggle_button)' failed

I've also tried dynamic_cast<>() but `pCheck' becomes NULL.

Thanks,

s.



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