Re: Overstrike in GtkEntry



>>>>> "B" == Bernd Demian <bdemian@csc-dd.de> writes:

 B> ...and second is there an mechanism like regex for formatted
 B> input, I mean date __.__.____ or time __:__ and so on, so that I
 B> can define a pattern for the entry.

I don't belive this is implemented in the entry right now, but you
could easily hack it by handeling the "changed" event or something.
It could however be nice with a widget for restricting input to
general regular patterns.  Either as a subclass of 'entry' or as
something you connect to an entry (like the way you connect tooltips
to widgets).

It shouldn't be that hard to do.  Whenever someone tries to change the
text, simply match the changes (plus of course the text already there)
against the regex.  If it matches, accept the changes, if not >>beep<<
the user. (or accept the editing but change the text color or
something).

The only thing you'll need to work a bit on is recognition of regular
patterns...and you could get that from a number of regex libraries, or
steal it from emacs.  I did that for syntax highlighting in my editor
;)

If you decide to do it, and if you get it to work, at least let *me*
know.  I think I could find use for such a thing :)

	/mailund



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