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.
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 :-)
|
Tags: binding