[Gtk-sharp-list] Entry EditingDone Event

Luciano Callero lnc19@hotmail.com
Wed, 22 Oct 2003 12:04:40 -0300


I've a Gtk Window with an Entry Widget. This entry must update a value 
(store in a property) after end editing.
I think that the EditingDone event that inherit from other its the correct, 
beacause i need to update when is changed in the entry and not when is 
change by Programming.

This is an "Example":

class Test:Window

              public string EntryValue = "";
              static void Main()
              Button button1 = new Button("Change The Entry");
               Entry entry1 = new Entry();

              // All the code that initialize the window

             button1.Clicked += new EventHandler(button1_clicked);
             entry1.EditingDonde += new EventHandler(entry1_editingdone);
             entry1.OnChange += new  EventHandler(entry1_onchange);

           public void button1_clicked(System.Object Sender, EventArgs args)
                     entry1.Text = "Test of Change"; // This must not update 
the value

          public void entry1_editingdone(System.Object Sender, EventArgs 
                         // HERE Does Not Enter
                         EntryValue = ((Entry)Sender).Text;

        public void entry1_onchange(System.Object Sender, EventArgs args)
                       Console.WriteLine("This is shown every time.");

I try 3 thinks:
1) Use OnChange event, but the problem was that on every key pressed (every 
value that is inserted) in the entry is updated automaticaly, and this will 
be very slow, beacause in realy i need to update a Row in a DataTable, and i 
must to search some positions and other thinks.
The other and the bigger problem is that, if i change the value of the entry 
internaly (like button1) it is fire the event onChange, and i must to use 
some "flag" and this is not very efficient. (Not for my)
2) The second idea that i have is to use EditingDone Event, but the problem 
is that it is never fires this event. I dont know if i'm using like it is.

The finally Question: Do i have to commit suicide? :) Do i need to start 
reading again?
Is there an event that is fire when end editing, but before that focus is 
lost. Like a Validate (in m$) event?
I'm using correctly the EditingDone Event?

Thanks in advance.

¿Estás buscando un auto nuevo?  http://www.yupimsn.com/autos/