minara – select tool code

Selection is just about there:

(define (select-mouse-up win button x y)
(let ((selection (pick-path-window win x y)))
(when selection
(if (= button 1)
(set-selection-ranges-var (window-buffer-main win)
      selection)
         (append-selection-ranges-var (window-buffer-main win)
selection)))))

The problem I have now is how to highlight the selection. Minara isn’t meant to do outlining (there are very good reasons for this). I was going to just override the colour on the selection buffer to be translucent red (or something) but I’m worried that will be inefficient. Possibly I can cheat and have an outline-rendering-protocol that is private, but I’m worried if I put hooks in for that people will try to use it in the main buffer. So I think I’ll have to take the inefficient but correct route, which seems to be the unofficial minara motto.

Technorati Tags:

Posted in Projects