Access to Cairo context outside of GtkDrawingArea draw_callback

Is it possible to access and change the context GtkDrawingAreaoutside of it draw_callback? If so, I would be very happy if you would provide a short example (any language) or tell me where I should look. All the examples that I have found so far are drawn inside the callback, so I wonder about the possibility.

+4
source share
2 answers

In GTK + 2, this was possible using the interaction of GDK and Cairo to get Cairo's context from GdkWindow. In GTK + 3, which is most likely what you are asking about, you can still do this with this and this .

XY. GTK + 3 , . draw , .

, , , . , .

+3

, , .

DrawingArea ::draw. ::draw (, ). , () (, , - ). ::draw, (, , , , , ).

GTK + , draw_cb.

+2

Source: https://habr.com/ru/post/1665361/


All Articles