[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: "John Jachna" <John_Jachna@yccatsmtp.ycc.yale.edu>
- Subject: Re: window-click-event/scrollin
- From: Luke Hohmann <firstname.lastname@example.org>
- Date: Thu, 28 Mar 91 15:30:06 -0500
- Cc: email@example.com
- In-reply-to: Your message of 28 Mar 91 13:10:48 +0800. <9103281820.AA00573@brazil.cambridge.apple.com>
I have a faced a similar problem in some code I have written. I'm
not sure if my solution is applicable to your needs, but consider:
1. Store the buffer range of the characters you want to "HyperText"
in some suitable object. This object also contains the function
to call in response to the click. Store a list of this objects
in a slot called 'hypertext-stuff *fred-window* - *hyper-fred-window*.
(OK, don't call it 'hypertext-stuff.... call it whatever you want!)
2. When the user clicks in the window, use the fred window
function 'window-point-position to determine which buffer
character the user clicked on.
3. Search through the slot 'hypertext-stuff until the character
clicked on is in one of the ranges. Then call the function
associated with that object.
Note that by making the desired range a list of ranges [ something
like '((1 4) (12 19) (23 34)) ] and then searching for any character
in that list your "HyperText" can be discontiguos.