logo       

Re: Verifying Entry inputs: msg#00167

gnome.gtk+.python

Subject: Re: Verifying Entry inputs

On Sat, 2005-02-26 at 08:43 -0300, Christian Reis wrote:
>On Fri, Feb 25, 2005 at 11:08:00AM +0000, Gustavo J. A. M. Carneiro wrote:
>> My solution, although also not perfect, was to place a small
>> gtk.STOCK_DIALOG_WARNING icon inside the entry, and toggle between
>> making it insensitive (=value OK) or sensitive (=bad value).
>
>Interesting! Can we see some screenshots of this?

Attached. Code in [1], but you won't be able to run it without
modifications (or installing gnumexp), I'm afraid.

> I had never thought of
>this approach and it sounds way cool (though it _does_ take up some of
>the entry's real estate). Dream scenario might be a window which
>overlays the screen when a validation error occurs.

Now that I don't understand. Can you explain better? "window which
overlays the screen"?

An interesting idea that I might try someday would be to reserve some
empty space in the dialogue window, and display in that space validation
errors as they occur.

>One of the issues with validation is a performance issue -- some stuff
>takes a while to validate (checking database contents, etc).

In my case, validation is very quick. It is just about sending the
entry context through a math expression parser in a corba server.
Nevertheless, validation occurs only after 100ms timeout, to avoid
interrupting gtk+ event processing too often.


> Another is
>the fact that certain patterns are only really validatable when
>completely entered (i.e. 123. is invalid but 123.2 is not, though I'm
>thinking of more complex situations than this -- involving database
>contents as well).

Well, if the validation feedback is non-intrusive, like in my example,
it's not too annoying to validate in real time, I think..

>
>This is one of the two major unsolved issues for me in UI work using
>GTK+. The other issue is selecting an item from a large (potentially
>database-driven) collection -- autocompletion combos are close, but
>still not what we really need.

Fernando San Martin Woerner decided to use EntryCompletion for this,
and added a pixmap for validation, which is from where I stole my idea.
See PixEntryCompletion in [2].


[1]
http://cvs.sourceforge.net/viewcvs.py/numexp/gnumexp/src/xygraph/Numexp_XYGraph/dialogs/util.py?rev=1.11&view=auto
[2] http://www.galilea.cl/~snmartin/b2evolution/blogs/index.php

Best regards.

--
Gustavo J. A. M. Carneiro
<gjc@xxxxxxxxxxxxx> <gustavo@xxxxxxxxxxxxxxxxxxxxx>
The universe is always one step beyond logic

Attachment: Screenshot-Plot Object.png
Description: PNG image

Attachment: Screenshot-Plot Object-1.png
Description: PNG image

_______________________________________________
pygtk mailing list pygtk@xxxxxxxxxx
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise