[plt-scheme] Autowrap in embedded text% snip

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Mar 25 16:04:40 EDT 2009

I think you have to use a canvas that implements `canvas:wide-snip<%>',
such as `canvas:wide-snip%'.

The docs for `add-tall-snip' say

   This method should only be called by add-tall-snip.

which looks like a typo (a method should only be called by itself?!)
until you click the `add-tall-snip', which turns out to be a method in
`canvas:wide-snip<%>'.

At Wed, 25 Mar 2009 19:57:11 +0000, Erich Rast wrote:
> 
> I just can't get this to work. :-/ I've made both editors instances of  
> text:wide-snip%. I create a snip from the first editor using (new  
> editior-snip% (editor theeditor)) and in the embedding editor tried   
> (send editor add-tall-snip snip) which has no visible effect at all.
> 
> I've also tried
> 
>   (let ((snip (new-box-editor-snip 'ask ""))) ; my function that  
> returns a snip
>        (send editor insert snip)
>        (send editor add-tall-snip snip))
> 
> This displays the embedded snip, but still no word wrapping or  
> automatic resizing. Both editors are instances of text:wide-snip%
> 
> Is there an example somewhere that illustrates how add-wide-snip, add- 
> tall-snip, and text:wide-snip% work?
> 
> Best regards,
> 
> Erich
> 
> > The framework has some support for that. Try searing for 'wide-snip'
> > in the docs.
> >
> > Robby
> >
> > On 3/23/09, Erich Rast <erich at snafu.de> wrote:
> >> x-height also doesn't seem to affect the wrapping.
> >>
> >> What I'd like to have is various embedded editors that extend  
> >> vertically
> >> as you type and automatically wrap text according to the width of the
> >> embedding editor. When the outer text% is resized, the embedded  
> >> editor
> >> snips should resize their width, too, but always display their whole
> >> content, i.e. only resize their height such that all of the content
> >> remains visible.
> 
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.