Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-03-03 18:57:03


"David Turner" <dkturner_at_[hidden]> wrote in message
news:30009.165.165.239.17.1078329677.squirrel_at_webmail.telkomsa.net...
> hi
>
> > I'm in full support of your effort. Just a small comment:
> >
> > int main(int argc, char* argv[])
> > {
> > window w = create_window();
> > w->title("Example window");
> >
> > why is window implicitly a pointer?
>
> In fact, window is defined thus:
>
> typedef boost::shared_ptr<window_base> window;
>
> The reason is that widgets are always reference-counted. The alternative
> would have been to make window a pimpl class, with the impl being
> reference counted. However, since I wanted to use the factory pattern to
> firewall the implementation of widgets, I would have to have my widgets on
> the heap anyway, so I just made widget a shared pointer to the WDT (whole
> damn thing).
>
> Does that make sense? :-)

yeah its ok, I was thinking that seing window and not window* could confuse
some.

>
> > Adn maybe
> >
> > 9. It should be possible to create worm-like games in it, where student
> > need
> > to draw the worm by moving
> > pixels or something around :-)
>
> Ha ha, yes.

Just to be sure, I'm not kidding. I assume a C++ gui lib should be possible
to use to learn C++. Writing small
games by moving pixels around is a great way to practice, much more fun than
making a menu or pop-up box.

br

Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk