Re: [racket-users] Making a snip% select itself in a text%

2017-03-02 Thread Erich Rast
I found an easy solution that does what I want it do to. It's only suitable for non-editable snips, of course. Instead of checking whether draw-caret is a pair in draw, I simply use (not (equal? draw-caret 'no-caret)) That does the job. As for keyboard events, I think I'll handle them in the sn

Re: [racket-users] Making a snip% select itself in a text%

2017-03-02 Thread Matthew Flatt
At Thu, 2 Mar 2017 11:12:16 +, Erich Rast wrote: > Hi! I have a simple non-editable and non-resizable snip% class that in > its draw function distinguishes whether it's selected or not. It works > fine when I select it in a text% with the mouse. > > Now I want to select it in the text% when th

[racket-users] Making a snip% select itself in a text%

2017-03-02 Thread Erich Rast
Hi! I have a simple non-editable and non-resizable snip% class that in its draw function distinguishes whether it's selected or not. It works fine when I select it in a text% with the mouse. Now I want to select it in the text% when the user left-clicks on it, so I've overridden on-event and tried