Boost logo

Boost :

Subject: Re: [boost] [rfc] cppgui
From: Tomas (pecholt_at_[hidden])
Date: 2009-06-22 08:12:56

I also agree that using MVC pattern for more complex controls like
tables and trees is a good thing because of its flexibility. On the
other hand there are situations where you only need to fill the
control with data and present it to the user. In such case using MVC
would mean redundant typying. So I would take inspiration from Qt
here. For example for a tree widget, there are two options: QTreeView
which has MVC interface and then QTreeWidget which inherits from
QTreeView, plugs default model and adds some easy interface for adding
items etc.

+1 for the named parameter interface which you introduced

Another very important aspect is layouting the controls. I think this
is so important feature it should be thought over in the beginning
(now). I have seen your examples and I saw you simply set position
and size for each widget. This is nice but it simply doesn't work for
real applications from 2 reasons:
- it's much simpler to set size constraints for widgets like maximum
   size, stretching factor, borders and then let the layout system to
   position and size widgets automatically than do the calculations and
   repositioning yourself when something changes (like when user resizes
   the dialog)
- if I understand it correctly your gui can be used to write
   multiplatform code. Like one code for windows and linux
   version of the app. But on every platform the sizes of individual
   widgets are different, the default fonts are different and you
   certainly don't want to be bothered with this.
For the start something like vertical/horizontal layout would be sufficient

It would be interesting to have an option to be be able to load GUI
definition from xml file. It would enable using GUI designers which
save time and also make code compile faster. But I understand it's
too early for such functionality.

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