GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Nov 01, 2014 4:10 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: GtkEntry autorestore previous
PostPosted: Wed Jan 30, 2013 11:40 pm 
Offline
Familiar Face

Joined: Thu Nov 22, 2012 3:46 pm
Posts: 22
It possible to autorestore previous entry in gtk_entry if new entry is invalid for same condition?

Example:

I want to entry in gtk_entry only alphabetic chars
If someone try to entry numeric char, gtk_entry to autorestore previous alphabetic char.

Thanks


Top
 Profile  
 
 Post subject: Re: GtkEntry autorestore previous
PostPosted: Wed Feb 06, 2013 10:47 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
This is not inbuilt into GtkEntry as at its base level all input is valid.
If you want to define a GtkEntry that is text only you will need to code this additional functionality in yourself (the string validator and storage of the old value). If you are doing this repeatedly then you may want to subclass GtkEntry as a custom widget.
Be careful; however, as a character text only widget can deem as invalid text that is more appropriately written with numerical values; e.g. in formal English writing, large values are written numerically rather than in full.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group