[cairo] GTK3+ | draw cairo object by button-click

Stefan Salewski mail at ssalewski.de
Sun Jan 17 19:02:32 UTC 2021


On Sun, 2021-01-17 at 19:21 +0100, Harald Schmidt wrote:
> The cairo_arc is only visible after button-click and additional
> mouse-
> click outside the window. Don't know why mouse-click outside the
> window
> is necessary .

Seems to be more a GTK question?

My guess is that you missed a queue-draw call. When the darea is
created the draw method may be called, but then radius is still zero.
And next update of drawing area occurs only when necessary, or when you
call queueDraw. You should find some examples in C with google, for
example there is a scribble window example somewhere, I think it is
called drawing.c now. I am using more Nim and GTK4 now, so I can not
provide a complete C example yet. But let us know when you should be
not able to fix it yourself, I can ask google later...



More information about the cairo mailing list