hello, I am porting my application from MacOS 9 to Carbon. I have a
while loop that SystemTask() while the mouse button is held down.
Since SystemTask() is not available in Carbon, is there another function
more appropriate I should call in this loop so my application doesn't
hog CPU resources?

Signature
Vincent
Milton Aupperle - 28 May 2004 23:51 GMT
> hello, I am porting my application from MacOS 9 to Carbon. I have a
> while loop that SystemTask() while the mouse button is held down.
>
> Since SystemTask() is not available in Carbon, is there another function
> more appropriate I should call in this loop so my application doesn't
> hog CPU resources?
Yes.
See "Tracking the mouse with TrackMouseLocation"
http://developer.apple.com/documentation/Carbon/Conceptual/Carbon_Event_
Manager/Tasks/chapter_18_section_10.html
HTH..
Milton Aupperle
Miro Jurisic - 29 May 2004 21:02 GMT
> hello, I am porting my application from MacOS 9 to Carbon. I have a
> while loop that SystemTask() while the mouse button is held down.
>
> Since SystemTask() is not available in Carbon, is there another function
> more appropriate I should call in this loop so my application doesn't
> hog CPU resources?
Reimplement your code to use mouse tracking events. See TrackMouseLocation and
TrackMouseRegion.
hth
meeroh

Signature
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>
Toby Thain - 30 May 2004 11:10 GMT
> hello, I am porting my application from MacOS 9 to Carbon. I have a
> while loop that SystemTask() while the mouse button is held down.
>
> Since SystemTask() is not available in Carbon, is there another function
> more appropriate I should call in this loop so my application doesn't
> hog CPU resources?
If you use WaitNextEvent, which is in Carbon[1], then SystemTask is
not needed at all.
(Unless you wish to rewrite around Carbon Events[2])
Toby
[1] http://developer.apple.com/documentation/Carbon/Reference/Event_Manager/event_mg
r_ref/function_group_5.html#//apple_ref/c/func/WaitNextEvent
[2] http://developer.apple.com/documentation/Carbon/Conceptual/Carbon_Event_Manager/
Concept/chapter_17_section_4.html