rir has asked for the wisdom of the Perl Monks concerning the following question:
I am looking for samples of Tk code with error checking for basic database
functions: Add, Delete, Find, Update.
Although I am very ready to look at other approaches, this is what I currently
consider adequate:
On leaving an Entry the textvariable is validated by a logical type.
If invalid focus is back to that Entry after a beep & an error message
widget is filled. The empty entry will generally be accepted to avoid
the lost user from being locked into a window.
On the execution of an update, delete or add, there is further validation
of fields against the database. At a mininum focus would move to the
first field on failure.
In query mode the rules would be lax and the -validatecommands
routines would generally return true.
|
|---|