[Gtk-sharp-list] gtk.entry validation difficulty

Jesper K. Pedersen linux at famped.dk
Wed May 21 15:48:50 EDT 2008


In connection with a small application I am writing I have run into a
slight problem.

I have a form consisting of several gtk.entry widgets and two buttons
for "cancel" and "accept"

Each gtk.entry needs data validated when it is edited (changed)
meaning when you either press enter or try to deselect the entry (by
for instance tab'ing/clicking on another entry) my program should
validate the content of the entry... Except in the case where you press
the "cancel" button which should just disregard all validation.

Currently my software is running fine if users don't do anything but use
"enter" to finalize data entry. I use the Entry.Activated handler to
validate my input. Unfortunately we have users who are creative with
using both the tabulate key and the mouse too.

I have tried using the Entry.EditingDone handler but I cannot get the
event to fire at all (the GUI is made in glade).

I have also tried using the Widget.FocusOutEvent but then trying to
press the "cancel" button will fire the validation event.

Any idea's/suggestions on how to get around this problem?


Thank's
   Jesper KP


More information about the Gtk-sharp-list mailing list