Boost logo

Boost :

From: Douglas Paul Gregor (gregod_at_[hidden])
Date: 2003-08-01 18:41:10


On Fri, 1 Aug 2003, E. Gladyshev wrote:
> > Pimpl definitely has its place.
>
> I agree, but boost::threads and boost::gui would be
> much better of with ImplTraits, in my opinion.

Because one might use multiple threading models in a single program? Since
we already have a boost::threads design to compare against, could you
explain how the ImplTraits idiom would improve it? I'm not attempting to
deflect: the problem with examples like the one you give below is that
it's all too easy to gloss over details that can sink a design.

> > If you buy Doug G.'s argument that no application
> > will use two
> > GUIs at once
>
> No I don't buy Doug's argument at all.
> Here is an example.
>
> //customize the edit control to be an eleptical shape.
> class ElepticalShapeWin32Impl : public gui::win32
> {
> //overload edit control stuff.
> };
>
>
> main()
> {
> gui::dialog<gui::win32> myStandardDlg;
>
> ...
>
> gui::dialog<gui::ElepticalShapeWin32Impl>
> myFancyDlg;
>
> ...
>
> }
>
> Eugene

Ah, so here's a question: what sort of relationship exists between
myStandardDlg and myFancyDlg? They will likely be similar semantically,
because we can still place widgets in each of them, show/hide them, etc.,
but they'll show up differently for the user.

Can I put a gui::button<gui::win32> into a
gui::dialog<gui::EllipticalShapeWin32Impl>? Or a
gui::button<gui::EllipticalShapeWin32Impl> into a gui::dialog<gui::win32>?
If so, how do the button and the dialog communicate, e.g., for adjusting
to a window resize event? I see two communication options:

        1) One communication system common to all GUI implementations?
Then we are stuck translating every message into and out of this
communication system. Not very clean, IMHO.

        2) Communication through the ImplTraits? This seems the natural
route, but now we have O(n^2) combinations of translations. What if I want
to stick a Qt button into a Win32 dialog? Or a gtk+ button into a Qt list
box in a Motif dialog?

In a cross-platform framework, how deeply ingrained should our
platform-specific decisions be? How does one write a truly portable GUI
app: by starting with gui::dialog<gui::win32>?

        Doug


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