Correct analysis of FAQ6.15?
- From: Bill Medland <billmedland mercuryspeed com>
- To: gtk-app-devel-list gnome org
- Subject: Correct analysis of FAQ6.15?
- Date: Fri, 12 Aug 2005 09:20:45 -0700
Hi guys.
I am researching the whole field of data entry validation,
including in Gtk+. I notice what is addressed in FAQ 6.15
(which I see in various forms around the Web) and a couple of
things popped out at me and I wanted to check that I do
understand the code properly. (I'm still a beginner to Gtk+ so
I feel unsure). Please note that I am not criticising the FAQ;
I just want to know what it can and cannot do.
Basically what I see it doing is the following:
1. Take the input that is being passed in. Remove or convert any
unacceptable characters and produce an equivalent but acceptable
input.
2. Temporarily disable the signal from the widget that is being
handled.
3. Insert the modified (now correct) input into the widget, just
as whatever is being handled did; but this time it won't send
the signal.
4. Reverse step 2;
5. Stop the signal propagating any further down the handler
chain.
Is that correct?
So it seems to me that this solution is going to be a problem if
there are multiple signal handlers. If there is a handler
called before this one it will handle the invalid input and
won't get a chance to handle the "corrected" input. If there is
a handler after this one it won't get to handle any input.
Is that a valid observation?
Might this be a more robust (but still unstable) solution?
1. Look at the input. If it is already acceptable then don't do
anything special.
2. If there is anything wrong with the input then create a
corrected copy, insert that (without disabling the signal) and
stop propagating the signal through its current chain.
(3. The corrected input will now come back into the top of the
chain, filter down and pass straight through this function).
Am I understanding it correctly?
--
Bill Medland
mailto:billmedland mercuryspeed com
http://webhome.idirect.com/~kbmed
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]