Re: GtkEntry



 Al,
 Thanks for the reply !
 Gus gaveme a good hint.

  My configuration dialog is a bit big and has several tabs, so it is a bit
impratical to use your approach (i.e. enable/disable).

  Check for his solution, it might be helpful to you as well.

Thanks again.

Harring.
--- Al Amaral <ama jabba East Sun COM> wrote:

 Folks,
 I have a GtkEntry (GtkCombo) that a user types in a file name. After the
user 
is done typing the file name, I would like to see if the file exists or
create
it right after he/she is "done", so that I can popup a dialog error in
case I
fail to create the file.

 NOTE: The user can also navigate the file system using a button on the
side of
the GtkCombo that opens a GTkFileSelection. So, tracking the cursor is
probably
not a good idea.

 NOTE2: All I need is a way to tell me when the user is done with that
entry.
(I already know how to do the other stuff; i.e. checking for file
existence and
opening a dialog).

  Thanks for any suggestion.

Harring.

I do this sort of thing in code that I have.  I don't want the user
to be able to press the Next button on a druid page until the file
which he has entered is a valid file.  What I do is hook up a signal
for "changed", and when the field changes (and it will for every key
stroke)  I get the value, and validate it.  Whenever it's valid I make 
the Next button sensitive, else it's insensitive.  So, the user cannot
move on to the next druid page until he has entered an appropriate
filename.

The problem you have is the definition of the word "done".  How will
you know that the user is done?  Will he hit enter, or a button?
If so, hook up signals for Activate for the GtkEntry and/or the
button, and before doing anything else when either is hit validate
the file...  If it's not valid pop up your error dialog.  If it is
then do your processing.

--Al Amaral--


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com



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