Re: GtkTextView question



Gustavo Giráldez <gustavo giraldez gmx net> writes: 
> What I really need is the view to tell me which portion of the text is
> about to draw.  By looking at the code I think a signal emission in
> gtk_text_view_validate_onscreen() should probably be enough.  Maybe I'm
> missing something?  If that's ok I can work out a patch.
> 

I think that's approximately right, the hard bit is the reentrancy... 

There are two kinds of change you can make:

 - if you just change colors, then in theory nothing is invalidated, 
   but a redraw will get queued. So you don't want to 
   change colors in response to expose_event, since during the 
   expose the redraw queue is already empty, so you'd get a new 
   queue/expose cycle (I think anyway)
 
 - if you change attributes of the text that might change 
   the size of the text, then you get invalidation

So the main issue is just to be sure that doing either of those
things, at the point where the signal is emitted, won't confuse the
widget. Does that make sense?

It may not be that hard, just needs to be thought about carefully.
People can do _anything_ in signal handlers... they usually do their
best to break stuff. ;-)

Havoc



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