[plt-scheme] Re: Post a HTML file

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Apr 7 21:52:45 EDT 2007

At Thu, 05 Apr 2007 08:52:10 -0700, "Laurent" wrote:
> Ok thanks, but I would like to print HTML page in a MrEd frame. Not in
> my browser.
> It is possible?

Do you mean something like this?:

 (require (lib "browser.ss" "browser"))

 (define f (new hyper-frame%
                [label "Demo"]
                [start-url "http://www.htdp.org/"]
                [width 400]
                [height 300]))

If so, here's a more minimal example using `render-html-to-text':

 (require (lib "htmltext.ss" "browser"))

 (define f (new frame%
                [label "Demo2"]
                [width 400]
                [height 300]))

 (define t (new (html-text-mixin text%)))

 (define c (new editor-canvas%
                [editor t]
                [parent f]))
 (render-html-to-text (open-input-string "<b>hi!</b>") t #t #t)

 (send f show #t)


Posted on the users mailing list.