DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Adding online help

Displaying manual pages with VtDisplayHelp

Using this procedure allows you to quickly display manual pages that are already on your system by using the VtDisplayHelp(1vtcl) command. This script is provided for your convenience:

# Small script to show how to get man pages displayed using the
# help interface
#
#   man book is     cgi-bin/man
#   topic is      man?<topic>[+section>
# Otherwise
#    book is dir in /usr/lib/scohelp
#    topic is filename in that dir

proc txtCB {tree cbs} { global bookw treew Topic Section

set book [ VtGet $bookw -value ]

# Tree seems to be the widget Tree string for Context sensitive help # only use here when fails to give docHome

if { [cequal $tree "0" ]} { unset tree } else { VtDisplayHelp [keylget cbs widget] -book $book -tree $tree return }

set topic $Topic if { [cequal $book "" ] || $book == "man" } \ { set book "cgi-bin/man" append fulltopic "man?" $topic set topic $fulltopic }

set section $Section if { ! [cequal $Section ""] } { global sectw set Section "" ;# should clear widget VtSet $sectw -value "" #format for search topic Section is man?topic+section append topic "+" $section }

#echo $book #echo $topic

VtDisplayHelp [keylget cbs widget] -book $book -topic $topic

}

proc hCB {book topic cbs} {

if { $book == "man" } \ { set book "cgi-bin/man" append fulltopic "man?" $topic set topic $fulltopic }

# VtDisplayHelp [keylget cbs widget] -book "cgi-bin/man" -topic "man?ls"

VtDisplayHelp [keylget cbs widget] -book $book -topic $topic }

proc ht { cbs } { pkeyl cbs }

proc TabCB { cbs } { if { [cequal [keylget cbs mode ] "done"] } { VtSet [keylget cbs widget] -focusDirection NEXT_TAB_GROUP } }

set Topic "" set Section "" set app [VtOpen Helptst] set f [VtFormDialog $app.f -title HelpDisplay \ -ok -okLabel Search -okCallback {txtCB "0" } \ -cancelCallback "VtClose; exit 0 ;#" ]

set b0 [ VtPushButton $f.b0 -label Home \ -callback "txtCB junk" -helpKeyCallback ht ] VtPushButton $f.bc -label Contribs \ -callback "hCB SCO_ENG scruz.html" -helpKeyCallback ht set b1 [ VtPushButton $f.b1 -label ls \ -callback "hCB man ls" -helpKeyCallback ht ] #set b1 [ VtPushButton $f.b1 -label file \ # -callback "hCB man file" -helpKeyCallback ht ] set b2 [ VtPushButton $f.b2 -label Panner \ -callback "hCB XPanHelp BOOKCHAPTER-1.html.Z" -helpKeyCallback ht ]

set bookw [VxText $f.book -label Book: -callback TabCB ] # set treew [VxText $f.tree -label "Tree: " ]

set sectw [VxText $f.s -label Section: -textVariable Section -callback TabCB] VxText $f.t -label Topic: -textVariable Topic -callback {txtCB "0"}

VtShow $f VtMainLoop


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004