Hey Thomas. Thanks for your contribution.
On Wed, 2007-10-31 at 16:25 +0100, Thomas Schmitz wrote:=20
> I wanted to implement the Table class as I saw that there is no way to
> handle that the constructor of the Table allows only restricted values
> as rows and columns. Means the value of 'rows' is restricted to be
> greater then 0 and smaller then 65536. So I have implemented the
> possibility to add a parameter in the .defs files. This parameter looks
> like '( > 0 & < 65536)'.
Eeek.
That's not valid scheme syntax, is it? I don't believe so. If we
accepted this patch it would mean that the other language bindings
wouldn't be able to use the .defs data anymore.
> But this is only an example for the
> GtkTable.defs, of course.
You can do this kind of validation in the bindings layer. That's what
it's there for. See Alignment.check() which is a private static method
(therefore callable during construction) which has the logic to validate
the input.
This shows up in quite a number of other places too, especially on the
'treeview' branch.
> Enclosed is a patch for the GtkTable.defs that you can see
> that the generator works.
Actually, for such a radical change it would also be appropriate to add
test case(s) to validate the correct parsing behaviour.
AfC
Canberra
|