Better way to handle text entry changes



Hello,

I am writing a GTK frontend for a volume management system with a plugin
architecture. Plugin configuration dialogs are built dynamically from
descriptors supplied by the plugins on what input data they need and
whether constraints are provided. Any input without a constraint is
entered through a GtkEntry widget.

The architecture is similar to the SANE frontends communicating device
configuration with SANE backend drivers.

My problem is that input data must be communicated as a whole to the
backend for validation. So, setting up a signal handler for the
"changed" signal does not help as it is invoked for every character. For
example, if this is a field for a name of some sort and the backend is
checking for name uniqueness then an error is reported if you try typing
"name12" when you already have "name1" since at some point it gets
"name1".

"activate" works if the user pressed the Enter key but this method is
not obvious, IMHO, to a user that they must press Enter so that the
value is communicated to the backend for validation.

Other things I've thought about were to issue the API to the plugins
when focus has left the entry and new text had been entered but this
does not work when it is the only or last entry field and it still has
focus.

My only other option is to have a "Update" button next to the text entry
field but this is also ugly and user unfriendly.

Anyone have better ideas?

regards,

Luciano








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