On 29-01-2020 15:14, Ron Tarrant wrote:
I'm working on a special request demo for the GtkDcoding blog wherein a slider is used to control the position of a ball on a DrawingArea.
I've run into what seems like a bug in the DrawingArea's redraw system, but I wanted to run it past you to be sure.
Hi, you are passing the wrong position to
queueDrawArea which is why the drawing area isn't updated.
The GTK documentation explains it like this:
The region here is specified in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as widget->window coordinates for widgets that return TRUE for gtk_widget_get_has_window(), and are relative to widget->allocation.x , widget->allocation.y otherwise.
So the coordinates of a drawing area start at x=0 y=0.
In this case it is also easier to call
queueDraw to invalidate the complete drawingArea/Widget.