[comp.sys.mac.programmer] ClikLoop & Scrollbars

keith@wiley.UUCP (Keith Scott) (07/27/88)

	I am a relatively inexperienced Mac programmer with the following
question/problem:

	I am writing a small editor based on TEdit and using the AutoScroll
feature.  I enabled AutoScroll and patched in my own ClikLoop routine
(using SetClikLoop) so that scrollbars would get updated while autoscrolling
is going on.  They aren't.

	I am running LightSpeed C 3.0 and, using the debugger, can watch
the scrollbar's value increase while the user is selecting (pretty nifty)
but the thumb doesn't get redrawn on the screen.  What's more, the
program won't do ANYTHING to the scrollbar (like inverting the contrlRect)
until another event (like an activateEvent or a mouseDown in the scrollbar)
is received, at which time the thumb warps to the right position.


Configuration:
	    Mac Plus, System 6.0, LightSpeed C 3.0, 2.5 Meg, Dataframe HD 


	    Any help would be appreciated,


			--Keith

--------------------------------------------------------------------
If I had expressed any opinions, they would have been solely my own.

-- 
		--Keith Scott 
		keith@wiley.uucp
		{csvax.caltech.edu,uunet.uu.net,trwrb.uucp}!wiley!keith

jkingdon@chinet.chi.il.us (James Kingdon) (07/29/88)

In article <2318@wiley.UUCP> keith@wiley.UUCP (Keith Scott) writes:
>	I am writing a small editor based on TEdit and using the AutoScroll
>feature.  I enabled AutoScroll and patched in my own ClikLoop routine
>(using SetClikLoop) so that scrollbars would get updated while autoscrolling
>is going on.  They aren't.
>the scrollbar's value increase while the user is selecting (pretty nifty)

I had this problem too, and what seems to be happening is that when your
ClikLoop routine is called the ClipRgn has been set to the viewRect.
So at the beginning of your ClikLoop routine, save the clipRgn, set it
to the whole window, and at the end of the ClikLoop routine restore it.
As nearly as I can tell this is documented nowhere in Inside Mac (sigh.
Volume V seems even worse to me than the first 4.)

nicky@cup.portal.com (07/29/88)

I have run into this problem in a number of different situations and have
racked my brains for many hours over this.  But, the solution for me has been
that I have previously set the clipRect to NOT include the scrollbars and so
they can't be drawn.  Check to see if this is not your problem also.

nicky@cup.portal.com