| >Hi folks.
>Due to server problems at ANU we are unable to access newsgroups, and so, I
>beg your forgiveness for this entirely off topic message.
>
>
>I've written a real-time midi program in C that spits out random notes and
>onsets. What I'd like to do is to control the range of the randomness with
>the mouse. Quickdraw.h defines a structure called point that stores the
>x,y values of screen pixels. Being very much a beginner as far as
>addressing the Mac events modus operandi, I'm unsure how to go about
>accessing coordinate info with the mouse, and unsure about whether I need
>to open a window first or not.
>If anyone could point me in the right direction I would be most grateful.
>
Hi Arne,
Try something like this (it runs perfectly in CodeWarrior):
#include
#include
void main()
{
Point thePoint;
while(!Button()){
GetMouse(&thePoint);
cout << "\n "<< thePoint.h <<" " << thePoint.v;
}
}
Regards,
Hans Timmermans mailto:hans.timmermans@kmt.hku.nl
Utrecht School of the Arts
fac: Art, Media and Technology.
dep: Music.
Senior Lecturer Computermusic and Softwaredevelopment.
phone: (+31) 35 6836464
fax: (+31) 35 6836480
PO-BOX 2471
1200 CL HILVERSUM
the NETHERLANDS
|