original commit: b0aad71852c22d87fd5a62fc9fb5633fe1182d1c
This commit is contained in:
Robby Findler 2000-04-04 22:05:14 +00:00
parent 545be9170d
commit c8c27f3ebc
2 changed files with 7 additions and 2 deletions

View File

@ -64,6 +64,7 @@
delay-action delay-action
local-busy-cursor local-busy-cursor
unsaved-warning unsaved-warning
text-snip<%>
read-snips/chars-from-text read-snips/chars-from-text
get-choice get-choice
open-input-buffer open-input-buffer

View File

@ -185,6 +185,7 @@
(send dialog show #t) (send dialog show #t)
result)])) result)]))
(define text-snip<%> (interface () get-string))
(define read-snips/chars-from-text (define read-snips/chars-from-text
(letrec ([get-snips (letrec ([get-snips
(lambda (text start end) (lambda (text start end)
@ -210,8 +211,11 @@
[(null? snips) [(null? snips)
(set! get-next (lambda () eof)) (set! get-next (lambda () eof))
eof] eof]
[(is-a? (car snips) string-snip%) [(or (is-a? (car snips) string-snip%)
(let ([str (send (car snips) get-text 0 (send (car snips) get-count))]) (is-a? (car snips) text-snip<%>))
(let ([str (if (is-a? (car snips) text-snip<%>)
(send (car snips) get-string)
(send (car snips) get-text 0 (send (car snips) get-count)))])
(let string-loop ([n 0]) (let string-loop ([n 0])
(cond (cond
[(< n (string-length str)) [(< n (string-length str))