draw on textview, gtk3 < 3.14



Hi list,

I'm trying to draw lines on a text view.

In my current solution I have placed a transparent drawing area on top of the text view. This does work 
unless the compositor is different from mutter (I guess). As a result in XFCE the drawing area isn't 
transparent while in Cinnamon and Unity I get the expected result.

Someone who used gtk2 managed to draw into the textview's 'expose-event' ( 
http://stackoverflow.com/questions/2027379/draw-lines-on-gtk-textview ). But using gtk3's 'draw-event' I 
can't come any close to his approach. 'drawable' has been abandoned and if I do anything inside the 
'draw-event', the whole content of the textview will be replaced by the new cairo buffer. Anyway to mix the 
old content?

I realized there's a 'draw_layer()' virtual function in gtk 3.14 and using it with the condition 
'GTK_TEXT_VIEW_LAYER_ABOVE' is very much what I need. But I don't think I can update my libraries that 
easily, especially because I need to create win32 compiles of my app soon.

So if you can point me to a way on how to draw lines on a textview using gtk3 but without the need of a 
compositing manager and without new versions like 3.14, I'd be very glad.

My gtk3 lib is 3.8, I'm using Vala but I'll be glad about any C- or Python-example as well. I should be able 
to adopt it after all.

Thanks a bunch in advance.

gilzad



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