Re: GtkTextView question



Gustavo Giráldez <gustavo giraldez gmx net> writes:
> 
> Is there some way to know in advance which lines will a GtkTextView
> widget show on the screen before the expose event?  I'm writing an
> incremental syntax highlighter (actually modifying GtkSourceView to do
> incremental highlighting) and I need this information beforehand to
> perform the tagging right before the expose event.
> 
> I tried hooking up the expose event, but I get some weird reentrancy
> (when I scroll too quickly) that causes an assertion on
> onscreen_validated to fail.  And besides, I don't think that's the
> correct way of doing it.
> 
> Any ideas?  Can this actually be done?
> 

I'm sure you can get it to work, you may need to look at gtktextview.c
and work with the internals a bit, or make small tweaks to the
internals and get those in bugzilla.

Generally I'd try using an idle handler, I guess, similar to the way
validation is done; but you need to set up the priorities of your
handler so that it runs before the validation handlers.

It'd be nice to have an API extension that works for this sort of
thing; my initial idea would be some kind of about_to_validate signal
that indicates a range is about to be validated. Of course that's
going to make all the scrolling/validation code in gtktextview.c even
_more_ scary... not a happy thought.

Havoc




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