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

Re: Limited chars input into entry widget.



Damian Kramer wrote:
> 
> I'm trying to use the entry widget for text input of a limited nature, i.e.
> I only wnat to allow certain chars to be added. At the moment I'm catching
> all keypresses, scanning the text for chars that are not allowed, removing
> them and then setting the text back.
> 
> This has the side effect of leaving the cursor dangling out in the middle of
> nowhere because the text length has changed. Trying to set the cursor
> position manually doesn't work.
> 
> Is there a nicer way to do this, or am I stuck with this kludge?

Look at the "insert-text" signal of the GtkEditable class. It will allow
you to intervene in any insertation in the entry.

-- 
René Seindal (rene@seindal.dk)			http://www.seindal.dk/rene/



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