[comp.windows.news] A beginner's problem !

skdutta@cs.tamu.edu (Saumen K Dutta) (06/07/90)

I have just started learning NeWS. I have the NeWS manual with me
but this
did not help me to solve the following problem.

I tried to simplify the example program "lines" from the sources
supplied with
the openlook package in order to understand the operation. Here is
the 
program

/LinesCanvas ClassCanvas 
[]

classbegin

/LineCount 20 def	

/setvalue{
	/LineCount exch def
} def

/LineDraw {
	0 2 LineCount div 1 {
	0 0 moveto 1 1 index lineto stroke
	0 0 moveto 1 lineto stroke
	} for
} def

/PaintCanvas{
	FillColor /FillCanvas self send
	clippath emptypath not {
	pathbbox scale translate
	StrokeColor setcolor
	/LineDraw self send
	} if
} def

/win [LinesCanvas] [/Footer false]
    framebuffer /newdefault ClassBaseFrame send
def

[LinesCanvas] /seticon win send

(Lines Demo) /setlabel win send
null /seticonlabel win send

/place win send
/activate win send
/map win send



This draws the default window on the screen with 20 lines. Now if I
want change
the number of lines from 20 to 5 I need to send a message to the
LinesCanvas
to do this.

I tried it as

5 /setvalue LinesCanvas send

Now I try to refresh the window by

{/paint self send} win send

this refreshes the window all right but suppose I only want to
refresh the
canvas and want to do it smoothly what do I do? I tried to do it as

/paintclient LinesCanvas send but it gives error. I tried so many
other
things (of course by not understanding the full process very
clearly!) but
was not able to do it. I don't want the full window to blink in order
to 
refresh but only the canvas. Can somebody enlighten me.

I think that the NeWS manual is not very informative as far as the
details
of the NeWS class instances and methods are concerned (At least not
for the
beginner!). Can somebody tell me if a better text is available for
this.

Note:- The above comments reflect my views

Thanks for the time and patience for this novice



--
     _                                   ||Internet: skdutta@cssun.tamu.edu  
    (   /_     _ /   --/-/- _            ||Bitnet : skd8107@tamvenus.bitnet 
   __)_/(_____(_/_(_/_(_(__(_/_______    ||Uucp : uunet!cssun.tamu.edu!skdutta
                                 ..      ||Yellnet: (409) 846-8803