Re: a bunch of issues



> I submitted a patch and a demonstartion program for the path that
> implements validation for GtkEntry,GtkSpinbutton and GtkCombo
> widgets earlier on in January.
> The patch and demo program can be found at :
> http://bugzilla.gnome.org/show_bug.cgi?id=50276
> The approach I took was to allow the developer to install a
> validation callback on an entry widget and then if the user
> tries to do something that would cause the focus to leave the
> entry, the event would be discarded.
>
> I was a little disappointed because I received exactly zero feedback,
> even a comment like "your approach sucks" would be better than
> no feedback at all.

You speak wisdom my friend!
In commercial apps the vaidation of user input is one of the most crucial
thou
probably the most tedious part of coding. GTK should encapsculate a uniform
api to do that.

The method I have always been applying is:
For every dialog I had a function doing validation of the related input
widgets. It
was invoked of focus-out. If it found the data entered unacceptable it was
changing
the font color to red and wrote some info on the status bar.
The on the Accept button being pressed the same function ws reinvoked to
once more
make sure everything is ok. Only then the dialog code was run.

This has proven to be very effective. Still there was a whole bunch of
pepetitve code to write.

I will try to start a debate over implementing such or a similar solution in
GTK in cuople of weeks.
(right now I have some nontrivial exams to pass ;)) As GTK strives to be a
professional
widget set for commercial apps as well, I hope it would get more feedbark
now.

Best regards!
Michal "Gleba" Ziemski




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]