Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uakari.primate.wisc.edu!dogie.macc.wisc.edu!uwm.edu!srcsip!manyjars!mnkonar
From: mnkonar@manyjars.SRC.Honeywell.COM (Murat N. Konar)
Newsgroups: comp.sys.mac.programmer
Subject: Re: TrackControl() problems
Keywords: TrackControl, CDEF
Message-ID: <32458@srcsip.UUCP>
Date: 25 Sep 89 19:31:18 GMT
References: <2838@murtoa.cs.mu.oz.au>
Sender: news@src.honeywell.COM
Reply-To: mnkonar@src.honeywell.com (Murat N. Konar)
Organization: ipd
Lines: 39

In article <2838@murtoa.cs.mu.oz.au> rob@cs.mu.oz.au (Robert Wallen) writes:
>I have a couple of custom-CDEFs I have been working on which use autotrak
>routines.
[edited for length]

>Now, when I call TrackControl() with my control, I see it hilite (sic) 
>correctly when the mouse is moved in/out of it but TrackControl ALWAYS
>returns the 'inButton' code that the first call to TestControl() within
>TrackControl() (yes, I can drive TMON) returned.  My CDEF is returning
>'inbutton/zero' correctly but TrackControl() seems to be ignoring
>it.  Its not clear from Inside Mac whether the autotrack message should
>actually return a value anyway; MacNosy would appear to say Nope.
>
>Should TrackControl() be returning zero if the mouse was released outside
>the active area, or should my caller just ignore TrackControl's return value?

Let's see.  I think I understand what your problem seems to be.  If
the following makes no sense, please try to clarify the problem. 

Here goes: 
TrackControl will return 0 if you release the mouse button outside of
the part you started in.  If the part is an indicator (like the thumb 
of the standard scroll bar), TrackControl will also return zero if you
move the thumb but move it back before you release it, even though
you released the mouse button in the same part you started in.  Perhaps 
you are having problems based on this phenomenon.  The reason for this
could be so that a window need not be updated if the control value
has not changed (this is the only rationalization I can come up with).

I don't have my code or IM volumes handy so this is about all
the explanation I can give with a degree of certainty.  Check
to see if the partcode your CDEF is returning is the one for
an indicator (254, I think).  I bet this is your problem.


____________________________________________________________________
Have a day. :^|
Murat N. Konar        Honeywell Systems & Research Center, Camden, MN
mnkonar@SRC.honeywell.com (internet) {umn-cs,ems,bthpyd}!srcsip!mnkonar(UUCP)