
David Turner wrote:
Hello
It seems that the idea of adding a medium-complexity GUI library to boost is popular, but that there are widely varying opinions on how it should be done.
I've written a first draft of a library that fulfils most of my expectations. It's available at http://www.turn.co.za/david/gui. It supports two platforms (Win32 and GTK2), and four user interface elements or widgets (window, label, button, text-entry). The design is such that it is extremely easy to support new platforms or widgets.
Looks very promising! Why is cast<> using a what looks like a homebrew RTTI system? Is there something that makes dynamic_pointer_cast<T::element_type>(w) inappropriate? Still on the cast<> subject, it should probably signal failure by throwing an exception derived from std::bad_cast, or maybe just return NULL, to allow the usual if( grid g = cast<grid>(w) ) { // ... } Have you considered the 'on_delete', 'on_change' naming scheme for signals (events)? It seems more GUI/RAD-like. Finally, when I see test->contain(create_label(test, "You pressed the \"Click me!\" button!\nHow clever!")); I wonder whether it would be feasible to eliminate the inner 'test', as it's logically redundant (a window probably can't contain something that is parented by another window). Although this would probably turn the architecture on its head, as it would require a new concept, a 'free widget'.