Discussions related to Visual Prolog
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Which other event invokes the onPaint event

Unread post by Ferenc Nagy »


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?
TIA, Regards,
Frank Nagy
User avatar
Thomas Linder Puls
VIP Member
Posts: 1253
Joined: 28 Feb 2000 0:01

Unread post 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.
Regards Thomas Linder Puls
Post Reply