Re: [gtkmm] Iterating through widgets; Passing data to callbackhandlers



> > Is there a way to iterate through all widgets of a window
> > with an unlimited depth?
> 
> Yes, use Container::children().

Yep, sorry, I missed that in the API documentations.

> > Inside the callback handler, I need to get the name (as defined in
> > Glade) and type of the widget that emitted the signal.
> 
> A dynamic_cast<> can tell you what the type is.

But the Gtk::Entry's "changed" signal does not pass any arguments
(Glib::SignalProxy0<void>)...
So, given the example from before:

entry1->signal_changed().connect(
        SigC::slot(*this, &PreferencesWindow::on_widget_changed));
void PreferencesWindow::on_widget_changed(void) {
  Gtk::Entry *entry = dynamic_cast<Gtk::Entry*>widgetpointer;
}

How would I get "widgetpointer" there?

Thanks for your help!

-Samuel



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