From: Joe E. <jen...@fl...> - 2005-11-10 14:51:37
|
Damon Courtney wrote: > Would anyone be opposed to me adding a -validtype argument to > options in SNIT? [...] > All it really does is override the -validatemethod for the given > option with a proc called snit::validateOption that does the very basic > validation of an option based on type. Why not just make [snit::validateOption] public and use [... -validatemethod [list snit::validateOption $type]]? > The types I've defined are: > > boolean > color > enum > int > nullboolean (can be boolean or null) ^^^^^^^^^^^ This one is a warning sign -- I can envision needing 'nullint', 'nullcolor', and 'nullpadding' too (e.g., Tile-based megawidgets would probably want to allow NULL values for many options); which would either lead to a proliferation of option types, or a new "-allownulls" option. I think making 'snit::validateOption' public (and adding any new validation-related options to *that* routine) would be a better factoring. --Joe English jen...@fl... |