[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] MPEdit



Rich Morin <rdm@cfcl.com> writes 1 Dec 1998 23:04:20 -0800:

>In looking at the {page,scroll}_{left,right,up,down} routines, I
>find myself wondering about the "if ($part ==" test.  That is:
>
>  *  If you know that the test will never be needed,
>     why are you doing it?
>
>  *  Even if the test may be needed at times,
>     shouldn't it enclose everything except parameter retrieval?

Thank you for your comment -- it raises an interesting point in a somewhat
undocumented corner of the Toolbox. I put the same question to Matthias
earlier this year and here is an extract from his reply on 08 Jun 1998:

>>I tried it this morning and confirm TrackControl() now accepts a procedure
>>and calls it repeatedly. But I think it is still not quite right: it should
>>stop calling the procedure if the mouse is a) down and b) dragged off the
>>arrow box should it not?
>
>Good question. It should *not* stop calling the procedure, but it took me some
>research to establish that fact. The procedure gets parameters:
>
>sub trackproc {
>  my($win, $part) = @_;
>}
>
>And you're supposed to check $part for yourself and suppress any action when
>it is 0 (it's always going to be either the original part or 0, at least for
>standard controls). This presumably allows you to implement visual feedback for
>the times in the track loop when the mouse is outside of the part (because
>you're not going to get control back until the mouse is released anyway).
>Matthias

So far as I can see it is only for ScrollBar 'arrow' and 'gray region'
parts that '$part' is passed on to a function in this way. Other controls
do not behave in like fashion, nor does the ScrollBar thumb slide come to
that.

Alan Fry



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch