Re: [gtk-list] Re: Overstrike in GtkEntry



Thomas Mailund Jensen wrote:
> 
> >>>>> "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

It is actually a bit more tricky than that.
Overstrikeing has not been implemented yet. It has been sitting around
on the source as an "Implement" for ages. I had once implemented it
together with most of the basic functionality of a masked entry. The
patch has been sitting around at ftp.gtk.org for about half a year now
and is propably outdateted by now. Have a look at it, it should still
make a good starting point.

Best wishes,
Jan



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