Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utcsrgv.UUCP Path: utzoo!utcsrgv!info-mac From: info-mac@utcsrgv.UUCP (info-mac) Newsgroups: ont.micro.mac Subject: Cursor Programming Message-ID: <4586@utcsrgv.UUCP> Date: Tue, 19-Jun-84 03:34:43 EDT Article-I.D.: utcsrgv.4586 Posted: Tue Jun 19 03:34:43 1984 Date-Received: Tue, 19-Jun-84 05:17:40 EDT Sender: peterr@utcsrgv.UUCP Organization: CSRG, University of Toronto Lines: 40 Date: 15 Jun 1984 1505-PDT Subject: Cursor Programming From: Mike SchusterTo: info-mac@SUMEX-AIM.ARPA Now that Bill Croft's SUMacC has been distributed, I guess will be subjected to more programming questions and info. May I? [Ed. By all means! Thats what this list in intended for.] When text editing, the shape of the cursor may be either 'ibeam' or 'arrow' depending if the cursor is pointing to text or not. The obvious code to handle cursors tests to see if the cursor position is within some rectangle containing the text. If so, the cursor is set to ibeam, otherwise it is set to arrow. This position test is repeatedly performed in the main event loop of the program, even if no mouse or other events occur. Unfortunately, this simple scheme will not always work correctly. For example, suppose you have just selected a time consuming command like Save from the File menu. While your file is being saved, you quickly try to pull down the File menu once again, holding the mouse button down as you move the cursor to the expected position of the command you now wish to invoke. You keep holding the button down until the save is finished and the menu actually appears. Don't let go of the button and look at the shape cursor. It should be an arrow, but using the above code, it might be an ibeam if the cursor is over text. Can someone suggest a better way to handle cursor shapes? Another question: When editing programs or tabular data, its handy if some rectangular region of text can be cut, copied, pasted, indented, etc. Does the Text Edit Manager have hooks so that such selections could be implemented? Mike (mikes@cit-20) -------