Welcome, guest | Sign In | My Account | Store | Cart

Author: Neil Madden Origin: http://wiki.tcl.tk/2993

The application fetches a web page, formats it, and displays it in a tk scrollable widget. It currently does not handle redirecting URLs, making the web pages active, or ease of changing fonts, etc. Requires TkHTML.

Tcl, 15 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
package require Tkhtml
package require http
pack [scrollbar .v -o v -co {.h yv}] -s right -f y
pack [html .h -ys {.v set}] -f both -e 1
bind .h.x <1> {eval g [.h href %x %y]}
proc g u {
    set t [http::geturl $u]
    .h cl
    .h p [http::data $t]
    http::cleanup $t
    .h co -base $u
}
g http://wiki.tcl.tk/976
proc bgerror args {}
# NEM :-)
Created by andreas kupries on Thu, 27 Jun 2002 (MIT)
Tcl recipes (162)
andreas kupries's recipes (20)

Required Modules

  • (none specified)

Other Information and Tasks