Restrict Class Properties?

Michiel nomail at please.com
Thu Feb 22 10:33:18 PST 2007


Manfred Nowak wrote:

>> Some concepts to apply to true properties:
> 
> What are this concepts good for in terms of provable correctness?

They're mostly syntactic sugar for normal programming.

However, I suppose they would be quite handy for GUI programming tools
(like QT designer, Visual Basic, etc). Any object/widget could have a
visible list of properties. The user of the GUI tool could change these
properties with a convenient set of textboxes, comboboxes, etc.

For example: properties for a push-button:
* label (string, textbox)
* font (font, font-dialog)
* height (uint, spinbox)
* width(uint, spinbox)
* top (uint, spinbox)
* left(uint, spinbox)
* border (enum, combobox)
* color (color, color-dialog)

If they were not recognized as real properties, they could not be in
such a list. You wouldn't want every little function to end up there.

QT designer uses some sort of C macro-trick to specify the properties
for their designer tool.

I suppose it would be good if D formalizes properties if only for this
purpose.

-- 
Michiel



More information about the Digitalmars-d mailing list