Re: Widget access

Marc Strämke <[email protected]> Wed, 10 Sep 2003 16:04:53 +0200
Newsgroups gmane.comp.embedded.stk.gui.devel
Message-ID <[email protected]>
Very big, not to say extreme objections!
Imnsho we're programming in c++, not in some damnit script language!
Why should any ppl who hasnt had his brain removed want to access 
widgets by name? If he really needs symbolic access to widgets, he can 
implement it himself, but access by name is really shitty.
To make it short, i dont think visual basic style programming should be 
part of the library, the user can always use a map of weak_ptr's to 
strings to have a symbolic lookup, its not the job of the library to 
take programming from the programmer.

ps.
Dont be too offended please *g*

Darren Vincent Hart wrote:
> 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