[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: window-click-event/scrollin



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.

  -- Luke