
At 11:13 AM 3/3/2004, Matthias Schabel wrote:
As far as the demo program :
int main(int argc, char* argv[]) { window w = create_window(); w->title("Example window"); w->contain(create_button(w, "Hello, world!")); wait_for_signal(w->delete_signal); }
why not :
int main(int argc, char* argv[]) { window w("Example window"); w.add(button("Hello, world!")); w.wait_for(delete_signal()); }
or something like that.
I really took an instant dislike to the original demo code. Matthias' "why not" version is much more to my taste. The "why not" version seems more like C++. The "demo" version seems like something left over from the C days. My own interest in a Boost GUI library would be for pretty simple applications and for teaching C++. Maybe a few medium complexity apps if the GUI requirements weren't too hard to meet. Now if such a GUI could also handle more complex apps, fine, but only if there is no impact on the simple "hello, world" level applications. Even the "why not" version seems overly complex compared to a console iostreams "Hello, world". Why not just: winout << title("Example window") << button("Hello, world!") << wait_for(delete_signal); I'm not necessarily pushing that exact approach, but just pointing out more C++-like alternatives. --Beman