home *** CD-ROM | disk | FTP | other *** search
-
- proc openURL {url} {
- set netscape [Shell_DoesBinaryExist_Prompt {netscape}]
- if {$netscape == ""} {
- DialogWin .error "Help System Error" "Could not find netscape. URLs will not be available." {} 0 OK
- return
- }
-
- if [catch {exec $netscape -remote "openURL($url, vmware-window, raise)" >& /dev/null} err] {
- if [catch {exec $netscape $url >& /dev/null &} err] {
- DialogWin .error "Help System Error" "Can't open $netscape." {} 0 OK
- }
- }
- }
-
-
- bind HtmlButton <ButtonPress-1> {
- %W configure -fg red
- set %W(active) 1
- set %W(inout) 1
- }
-
- bind HtmlButton <ButtonRelease-1> {
- %W configure -fg blue
- set %W(active) 0
- if {[set %W(inout)]} {
- openURL [set %W(url)]
- }
- }
-
- bind HtmlButton <Leave> {
- if {[set %W(active)]} {
- %W configure -fg blue
- }
- set %W(inout) 0
- }
-
- bind HtmlButton <Enter> {
- if {[set %W(active)]} {
- %W configure -fg red
- }
- set %W(inout) 1
- }
-
- proc htmlButton {name url text} {
- global $name
-
- label $name -fg blue -cursor hand2 -text $text
-
- bindtags $name "$name HtmlButton . all"
-
- set ${name}(active) 0
- set ${name}(inout) 0
- set ${name}(url) $url
-
- return $name
- }
-
-
-