Re: GtkEntry - simple question



On Thu, 2002-07-25 at 10:25, Harring Figueiredo wrote:


 Folks,

 ( GTK 1.2)
 Here is the dilema. How do I know when the user has finshed entering the text
into a GtkEntry ?

  This is what I have:

   File Name: 
   +---------------------------------+   +--------+
   |                                 |   | Browse |
   +---------------------------------+   +--------+


 The user can either browse (using the FileSelection) or he can type the file
name.
  I already got the file name from the "Browse" working.
  But I am still having difficulties "knowing" when the user has finiehd typing
the file name or done browsing so that I can check if the filename is valid
etc...
  I used the changed envent, but it is signaled every time the user types a
key.
  I also used other events to no avail (insert text, leave).

  So, how can I know: 

  1) the used is done typing the file name ?

  2) the user finished with the file selection (emit a signal myself ?)

Thanks in advance.


Harring,

I had a similar dilemma and to solve it, I check for both the "activate"
and "focus-out-event" on the entry field. So if the user either hits
enter when focus is in the entry field, I validate or when the field
loses focus, due-to tabbing out or clicking on something else, I
validate. It was not a perfect solution but it helped.
 
-- 
regards,

Luciano Chavez

lnx1138 us ibm com          
http://evms.sourceforge.net




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