3 ;; html-demo.lsp - demonstrate the text pane with HTML
7 (load (append (env "NEWLISPDIR") "/guiserver.lsp"))
12 (gs:frame
'HtmlDemo
100 100 400 270 "HTML text-pane demo")
13 (gs:text-pane
'HtmlPane
'htmlpane-action
"text/html" 200 500)
14 (gs:set-editable
'HtmlPane nil
)
15 (gs:set-tab-size
'HtmlPane
4)
16 (gs:set-font
'HtmlPane
"Monospaced" 14 "plain")
17 (gs:set-background
'HtmlPane
1 1 0.96)
19 (if (= ostype
"Win32")
20 (set 'url
(string "file:///" (env "PROGRAMFILES") "/newlisp/guiserver/html-demo.lsp"))
21 (set 'url
"file:///usr/share/newlisp/guiserver/html-demo.lsp")
24 (set 'page
(format [text]
26 <center><br><h2>Text panes for HTML</h2></center>
28 <p>This is a page of <i>html</i> text with a clickable hyperlink
29 <a href="%s">html-demo.lsp</a>.</p>
31 <p>The previous link expects the file <tt>html-demo.lsp</tt> in
32 the current directory from where the program was started.</p>
34 <p>Only simple pages are processed correctly.</p>
40 (gs:set-text
'HtmlPane page
)
41 (gs:append-text
'HtmlPane
"This is appended text")
42 (gs:add-to
'HtmlDemo
'HtmlPane
)
43 (gs:set-visible
'HtmlDemo true
)
46 (define (urlfield-action id txt
)
49 (define (htmlpane-action id text
)
52 ;;;; listen for incoming action requests and dispatch