Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-07-28 13:49:35

> Uh. I would not recommend inheriting from STL. I
> think that template
> policies would be rather more appropriate solution:

I agree with that.

> myWindow.create_widget<mylistbox>

Just a note.
Ideally, the library won't have to deal with the
numeric control ID's. You create a widget object and
from now on you use the object's pointer/reference to
access it (no need for an ID). One exception would be
dialog boxes. Usually resource files are ID-based so
we'll probably need to use the ID's.

boost::gui::dialog<> dlg(IDD_HELLO);
boost::gui::edit* hello_edit(
dlg.get<boost::gui::edit>(IDC_EDIT_HELLO) );

Under the covers the get function would do something
like this:

template< typename T, typename ID = int >
T* dlg::get( ID id )
    dlg::const_iterator it;
    for( it = begin(); it < end(); ++it )
        if( it->getid() == id )
            return static_cast<T*>( *it );
    return NULL;

It'd be nice to get rid of numeric id's completely.
Any ideas?


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Boost list run by bdawes at, gregod at, cpdaniel at, john at