[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

805.0. "Calling all gurus" by WHYVAX::KRUGER () Wed Oct 14 1987 13:33

    To all you Amiga Gurus out there (not meant in the derogatory sense)
    
    I'm just starting to do Amiga-specific stuff. I remember there is
    a way to open a window without lots of declarations and includes
    etc. It's something using creat() -- but I don't remember what.
    Can anyone enlighten me?
    
    Second, I'd like an equally cheap way to tell where the mouse is.
    Is there any way to just readmouse(x,y) or do you have to set up
    structures, DoIO, etc?

    Thanks,
    dov
T.RTitleUserPersonal
Name
DateLines
805.1Z::TENNYDave Tenny - VAX LISP DevelopmentWed Oct 14 1987 16:2517
I can help with the first questions (somewhat).
The easy way to create windows is to just treat them 
like ordinary files.
  fp = fopen("CON:X/Y/WIDTH/HEIGHT/TITLE", "w") ;

You need some funny combination of append or other
read/write indicators to do both to a window created this way.
I don't remember what it is.

Second question:
  I don't remember exactly, but I think you can get 
  mouse coordinates broadcast to you through IDCMP
  fairly easily. You don't need any of the device driver stuff.
  But I'm sure someone who has done this more recently
  will give you a better answer.

Dave
805.2WHYVAX::KRUGERWed Oct 14 1987 18:047
re .1
    
    Thanks Dave! As for the second question, I'd like to add that I'd
    like to be given the character grid coordinate, not the pixel coords.
    if possible.
    
    dov
805.3Z::TENNYDave Tenny - VAX LISP DevelopmentThu Oct 15 1987 09:549
If character "grid" coordinate == character "cell" coordinate,
I think you're out of luck unless you use the console.device.

Then you use send the console device the DEVICE STATUS REPORT
command sequence, to obtain row/column coordinates of the
cursor, but not the mouse.  I don't believe there is any
built-in way to get character cell indexes for mouse position.

Dave
805.4mapping depends on fontSAUTER::SAUTERJohn SauterThu Oct 15 1987 10:074
    Keep in mind that the mapping of pixels to character cells
    depends on the font you are using.  If you change fonts in
    the middle of a line the mapping is not trivial!
        John Sauter
805.5Use Intuition Messages, minimal setupCURE::WISNERThu Oct 15 1987 13:5822
    The mouse X and Y coords are in the Screen structure.  The Workbench
    screen has an assiciated screen structure.  I don't know how to
    get it right now.    
    
        X = Screen.MouseX;
    	Y = Screen.MouseY;
    
    There better way to do this is to have your program wait() for a
    MOUSEBUTTON message.  The message structure will contain the mouse
    coords at the time of the button press.  I believe the coords are
    in the pixel coords of the window, I'm not certain.    
    
    You can also get MOUSEMOVE messages everytime the mouse moves a
    tick.  Your program has to deal with a very high volume of messages.
    
    If you stay with Intuition, messages or pretty easy to use.  The
    Amiga Intuition book has good examples.  Look at the example program
    at the end of chapter 2.
    
    I don't know of any way to create a screen without first initializing
    a NewWindow structure, easy enough, except to fopen a CON: