[plt-scheme] unclickable clickbacks in interactions window snips

From: Ryan Culpepper (ryan_sml at yahoo.com)
Date: Fri Jan 27 13:46:11 EST 2006

--- Robby Findler <robby at cs.uchicago.edu> wrote:

> At Wed, 25 Jan 2006 14:46:33 -0800 (PST), Ryan Culpepper wrote:
> > 
> > --- Robby Findler <robby at cs.uchicago.edu> wrote:
> > 
> > > At Tue, 24 Jan 2006 15:41:59 -0800 (PST), Ryan Culpepper wrote:
> > > > I discovered that when an expression evaluates to an
> editor-snip%
> > > > object in the DrScheme interactions window, DrScheme actually
> > > inserts
> > > > the snip into the window. This is wonderful!
> > > 
> > > If "wonderful" also entails "security hole" we're on the same
> page
> > > ;)
> > > 
> > > > But if I add clickbacks to the text displayed by the editor,
> they
> > > > aren't activated when I click the text. The clickbacks work
> as
> > > > expected when I put the same object into an editor-canvas in
> > > another
> > > > frame.
> > > > 
> > > > Is there anything I can do to get the clickbacks to work, or
> does
> > > > DrScheme intentionally block clickbacks from user snips? (The
> > > > editor-snip is not created by a tool, just by an ordinary
> MrEd
> > > > program.)
> > > 
> > > You probably need to override the copy method (that's just a
> guess,
> > > but that's usually what gets missed in this situation).
> > 
> > To clarify: I'm not creating a new subclass of snip%, I'm just
> > putting some things in an instance of an editor-snip%. That class
> > already seems to implement the copy method (at least, I can
> display
> > them multiple times in the interactions window, and I can copy
> and
> > paste them).
> 
> I understand. you need to override the copy method to make sure you
> modifications make it into the copy, I guess.
> 
> Did you try it?

I reorganized my code, created a new subclass of editor-snip% just
for this purpose, and overrode the copy method in that new class.

It works perfectly now. Thanks!

Ryan


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Posted on the users mailing list.