Widget access
Darren Vincent Hart <[email protected]> Tue, 09 Sep 2003 17:17:36 -0600
| Newsgroups | gmane.comp.embedded.stk.gui.devel |
|---|---|
| Message-ID | <1063149455.18710.130.camel@sway> |
Many toolkits provide named access to widgets. I can imagine situations
where access to a widget that is not in scope will be useful (a file
full of callbacks that can be connected to signals comes to mind). I
think we will want something like:
widget::ptr my_widget = application::get()->lookup_widget("name");
The application singleton makes sense because the application can access
all the widgets (at least indirectly) and there is already global access
provided to it.
This would imply an additional std::string name_ member to all widgets
and a lookup_widget() routine to be added to application, container, and
widget.
Are there any objections to this, any ideas for a better solution (that
can be implemented for version 1 - an XML tree is not reasonable for
version 1).
Darren