]> git.saurik.com Git - apple/security.git/blob - SecuritySNACCRuntime/tcl-lib/help.tcl
Security-54.1.tar.gz
[apple/security.git] / SecuritySNACCRuntime / tcl-lib / help.tcl
1 # file: help.tcl
2 # toplevel widget to display a help text (modal)
3 #
4 # $Header: /cvs/Darwin/Security/SecuritySNACCRuntime/tcl-lib/help.tcl,v 1.1.1.1 2001/05/18 23:14:10 mb Exp $
5 # $Log: help.tcl,v $
6 # Revision 1.1.1.1 2001/05/18 23:14:10 mb
7 # Move from private repository to open source repository
8 #
9 # Revision 1.1.1.1 1999/03/16 18:06:55 aram
10 # Originals from SMIME Free Library.
11 #
12 # Revision 1.1 1997/01/01 23:11:54 rj
13 # first check-in
14 #
15
16 #\[sep]-----------------------------------------------------------------------------------------------------------------------------
17 proc help {w helptext} \
18 {
19 set help .help
20 set text $help.text
21 set sb $help.sb
22 set dismiss $help.dismiss
23
24 getpos $w x y
25 incr x -100
26 toplevel $help -class Dialog
27 wm title $help {Help}
28 wm transient $help .
29 wm geometry $help +$x+$y
30 wm minsize $help 0 0
31
32 text $text -borderwidth 2 -relief sunken -yscrollcommand [list $sb set] -width 32 -height 8
33 scrollbar $sb -relief sunken -command [list $text yview] -width 10 -cursor arrow
34 button $dismiss -text Dismiss -command [list destroy $help]
35
36 pack $dismiss -side bottom -pady 2
37 pack $sb -side right -fill y
38 pack $text -expand true -fill both
39
40 bind $text <Any-Key> [list destroy $help]
41
42 $text insert end $helptext
43
44 set oldfocus [focus]
45 focus $text
46 tkwait window $help
47 focus $oldfocus
48 }