Page 1 of 1

Which other event invokes the onPaint event

Posted: 27 Dec 2013 12:33
by Ferenc Nagy
Hi,

I want to display a graph consisting of textual labels, numeric scal., gridlines and and closed polygon.
The "devboxer" example uses the onPaint event to display the graph.

I have made a predicate to make all necessary plot element using the using the windowGDI interface.

Code: Select all

predicates     onPaint : drawWindow::paintResponder. clauses     onPaint(Source, Rectangle, GDI):-         drawSet(Source,GDI).
I have put its call in the onShow event.
I have seen nothing.
I have to minimize and resize the graphic window in order to see the graph.
When is the onPaint event executed?

I use in other branch of my program old fashioned vent handling:

Code: Select all

testWindowHandler(H, e_Update(_Update_Rect)) = 3 :-         paintDrawModes(H,winGetClientRect(H),winGetText(H),winGetData(H)),         !.

Were the painting is invoked from the update event?

Where are the best and necessary places of the drawSet calls in order to complete refreshing of the graph in case of size changes of the Task and Picure Windows?

Posted: 28 Dec 2013 15:31
by Thomas Linder Puls
onPaint should be attached as a paint listener (and only as that; the show event is irrelevant/wrong). You may have to invalidate the window in the size event.