Hi all,<br><br>I&#39;m having problems getting the contents in a text% to scroll within an editor-snip%.<br><br>The attached code displays part of a long string within a text% object in a smaller editor-snip% object. The print statements successfully show a few of the edit locations at some selected (x, y) points in the editor. <br>
<br>I think I&#39;ve tried all of the scrolling functions in each of the various components (editor-canvas%, editor-admin%, editor-snip%, text%) and am unable to change the portion of the string that displays. I&#39;m probably doing something stupid, can anyone give me any hints? <br>
<br>Cheers,<br><br>Kieron.<br><br>****<br><br>#lang racket/gui<br><br>(define f (instantiate frame% (&quot;Pasteboard Test&quot; #f 600 400)))<br>(define c (instantiate editor-canvas% (f)))<br><br>(define p (instantiate pasteboard% ()))<br>
(send c set-editor p)<br><br>(send f show #t)<br><br>(define t (new text% [auto-wrap #f]))<br>(send t insert &quot;hello world .... pasteboard one two three ... goodbye world ... alpha bravo charlie delta echo foxtrot golf hotel india juliet kilo lima mike november oscar papa quebec romeo sierra tango uniform victor whiskey xray yacht zulu&quot; 0)<br>
<br>(define s (new editor-snip% [editor t]))<br><br>(send s set-min-width 250)<br>(send s set-max-width 250)<br><br>(send p insert s)<br><br>(printf &quot;  text dimensions:(~a ~a) (~a ~a)~n&quot; <br>        (send t get-min-width) (send t get-min-height) <br>
        (send t get-max-width) (send t get-max-height))<br>(printf &quot;  snip dimensions:(~a ~a) (~a ~a)~n&quot; <br>        (send s get-min-width) (send s get-min-height) <br>        (send s get-max-width) (send s get-max-height))<br>
<br>;; print information about certain locations in the text<br>;(send t find-position x y at-eol? on-it? edge-close?)                    <br>(define at-eol? (box 0))<br>(define on-it? (box 0))<br>(define edge-close? (box 0))<br>
(printf &quot;  (5,5): ~a ~a ~a ~a~n&quot; <br>        (send t find-position   5 5 at-eol? on-it? edge-close?) (unbox at-eol?) (unbox on-it?) (unbox edge-close?))                    <br>(printf &quot; (25,5): ~a ~a ~a ~a~n&quot; <br>
        (send t find-position  25 5 at-eol? on-it? edge-close?) (unbox at-eol?) (unbox on-it?) (unbox edge-close?))                    <br>(printf &quot;(100,5): ~a ~a ~a ~a~n&quot; <br>        (send t find-position 100 5 at-eol? on-it? edge-close?) (unbox at-eol?) (unbox on-it?) (unbox edge-close?))                    <br>
(printf &quot;(200,5): ~a ~a ~a ~a~n&quot; <br>        (send t find-position 200 5 at-eol? on-it? edge-close?) (unbox at-eol?) (unbox on-it?) (unbox edge-close?))                    <br>(printf &quot;(400,5): ~a ~a ~a ~a~n&quot; <br>
        (send t find-position 400 5 at-eol? on-it? edge-close?) (unbox at-eol?) (unbox on-it?) (unbox edge-close?))                    <br><br>;; scroll to certain locations in the text<br>(define (do-scroll-text)<br>  (printf &quot;scroll:~a~n&quot; (send (send t get-admin) scroll-to -400 0 50 50 #t &#39;none))<br>
  (sleep 1.0)<br>  (printf &quot;scroll:~a~n&quot; (send t scroll-to s 200 0 50 50 #t &#39;start))<br>  (sleep 1.0)<br>  (printf &quot;scroll:~a~n&quot; (send p scroll-to s 400 5 50 50 #t &#39;start))<br>  (sleep 1.0)<br>
  (printf &quot;scroll:~a~n&quot; (send t scroll-to s 800 5 50 50 #t &#39;start))<br>  (sleep 1.0)<br>  )<br><br>(thread do-scroll-text)<br><br>