a2p
accept
access
acct
addftinfo
addr2line
adjtime
afmtodit
after
aio_cancel
aio_error
aio_read
aio_return
aio_suspend
aio_waitcomplete
aio_write
alias
aliases
alloc
anvil
append
apply
apropos
ar
array
as
asa
asn1parse
at
atq
atrm
attemptckalloc
attemptckrealloc
authlib
authtest
autopoint
awk
b64decode
b64encode
basename
batch
bc
bdes
bell
bg
bgerror
biff
big5
binary
bind
bindkey
bindtags
bindtextdomain
bio
bitmap
blowfish
bn
bootparams
bootptab
bounce
brandelf
break
breaksw
brk
bsdiff
bsdtar
bsnmpd
bspatch
bthost
btsockstat
buffer
builtin
builtins
bunzip2
button
byacc
bzcat
bzegrep
bzfgrep
bzgrep
bzip2
c2ph
c89
c99
ca
cal
calendar
canvas
cap_mkdb
case
cat
catch
catman
cc
cd
cdcontrol
chdir
checkbutton
checknr
chflags
chfn
chgrp
chio
chkey
chmod
chown
chpass
chroot
chsh
ci
ciphers
ckalloc
ckdist
ckfree
ckrealloc
cksum
cleanup
clear
clipboard
clock
clock_getres
clock_gettime
clock_settime
close
cmp
co
col
colcrt
colldef
colors
colrm
column
comm
command
compile_et
complete
compress
concat
config
connect
console
continue
core
courierlogger
couriertcpd
cp
cpan
cpio
cpp
creat
crl
crontab
crunchgen
crunchide
crypt
crypto
csh
csplit
ctags
ctm
ctm_dequeue
ctm_rmail
ctm_smail
cu
cursor
cursors
cut
cvs
date
dbiprof
dbiproxy
dc
dcgettext
dcngettext
dd
dde
default
defer
deliverquota
des
destroy
devfs
df
dgettext
dgst
dh
dhparam
dialog
diff
diff3
dig
dir
dirent
dirname
dirs
discard
disktab
dngettext
do
domainname
done
dprofpp
dsa
dsaparam
dtmfdecode
du
dup
dup2
eaccess
ec
ecdsa
echo
echotc
ecparam
ed
edit
editrc
ee
egrep
elf
elfdump
elif
else
enc
enc2xs
encoding
end
endif
endsw
engine
enigma
entry
env
envsubst
eof
eqn
err
errno
error
errstr
esac
ethers
euc
eui64
eval
event
evp
ex
exec
execve
exit
expand
export
exports
expr
extattr
extattr_delete_fd
extattr_delete_file
extattr_get_fd
extattr_get_file
extattr_set_fd
extattr_set_file
f77
false
famm
famx
fblocked
fbtab
fc
fchdir
fchflags
fchmod
fchown
fcntl
fconfigure
fcopy
fdescfs
fdformat
fdread
fdwrite
fetch
fg
fgrep
fhopen
fhstat
fhstatfs
fi
file
file2c
fileevent
filename
filetest
find
find2perl
finger
flex
flock
flush
fmt
focus
fold
font
fontedit
for
foreach
fork
format
forward
fpathconf
frame
from
fs
fstab
fstat
fstatfs
fsync
ftp
ftpchroot
ftpusers
ftruncate
futimes
g711conv
gb2312
gb18030
gbk
gcc
gcore
gcov
gdb
gencat
gendsa
genrsa
gensnmptree
getconf
getdents
getdirentries
getdtablesize
getegid
geteuid
getfacl
getfh
getfsstat
getgid
getgroups
getitimer
getlogin
getopt
getopts
getpeername
getpgid
getpgrp
getpid
getppid
getpriority
getresgid
getresuid
getrlimit
getrusage
gets
getsid
getsockname
getsockopt
gettext
gettextize
gettimeofday
gettytab
getuid
glob
global
gmake
goto
gperf
gprof
grab
grep
grid
grn
grodvi
groff
groff_font
groff_out
groff_tmac
grog
grolbp
grolj4
grops
grotty
group
groups
gunzip
gzcat
gzexe
gzip
h2ph
h2xs
hash
hashstat
hd
head
help2man
hesinfo
hexdump
history
host
hostname
hosts
hosts_access
hosts_options
hpftodit
http
hup
i386_get_ioperm
i386_get_ldt
i386_set_ioperm
i386_set_ldt
i386_vm86
iconv
id
ident
idprio
if
ifnames253
ifnames259
image
imapd
incr
indent
indxbib
info
infokey
inode
install
instmodsh
interp
intro
introduction
ioctl
ipcrm
ipcs
ipf
ipftest
ipnat
ippool
ipresend
issetugid
jail
jail_attach
jobid
jobs
join
jot
kbdcontrol
kbdmap
kcon
kdestroy
kdump
kenv
kevent
keycap
keylogin
keylogout
keymap
keysyms
kgdb
kill
killall
killpg
kinit
kldfind
kldfirstmod
kldload
kldnext
kldstat
kldsym
kldunload
klist
kpasswd
kqueue
kse
kse_create
kse_exit
kse_release
kse_switchin
kse_thr_interrupt
kse_wakeup
ktrace
label
labelframe
lam
lappend
last
lastcomm
lastlog
lchflags
lchmod
lchown
ld
ldap
ldapadd
ldapcompare
ldapdelete
ldapmodify
ldapmodrdn
ldappasswd
ldapsearch
ldapwhoami
ldd
leave
less
lesskey
lex
lgetfh
lhash
libnetcfg
library
limit
limits
lindex
link
linprocfs
linsert
lint
lio_listio
list
listbox
listen
lj4_font
lkbib
llength
lmtp
ln
load
loadfont
local
locale
locate
lock
lockf
log
logger
login
logins
logname
logout
look
lookbib
lorder
lower
lp
lpq
lpr
lprm
lptest
lrange
lreplace
ls
lsearch
lseek
lset
lsort
lstat
lsvfs
lutimes
lynx
m4
madvise
magic
mail
maildiracl
maildirkw
maildirmake
mailq
mailx
make
makeinfo
makewhatis
man
manpath
master
mc
mcedit
mcview
md2
md4
md5
mdc2
memory
menu
menubar
menubutton
merge
mesg
message
mincore
minherit
minigzip
mkdep
mkdir
mkfifo
mkimapdcert
mklocale
mknod
mkpop3dcert
mkstr
mktemp
mlock
mlockall
mmap
mmroff
modfind
modfnext
modnext
modstat
moduli
more
motd
mount
mprotect
mptable
msdos
msdosfs
msgattrib
msgcat
msgcmp
msgcomm
msgconv
msgen
msgexec
msgfilter
msgfmt
msggrep
msginit
msgmerge
msgs
msgunfmt
msguniq
mskanji
msql2mysql
msync
mt
munlock
munlockall
munmap
mv
myisamchk
myisamlog
myisampack
mysql
mysqlaccess
mysqladmin
mysqlbinlog
mysqlcheck
mysqld
mysqldump
mysqld_multi
mysqld_safe
mysqlhotcopy
mysqlimport
mysqlshow
mysql_config
mysql_fix_privilege_tables
mysql_zap
namespace
nanosleep
nawk
nc
ncal
ncplist
ncplogin
ncplogout
neqn
netconfig
netgroup
netid
netstat
networks
newaliases
newgrp
nex
nfsstat
nfssvc
ngettext
nice
nl
nm
nmount
nohup
nologin
notify
nroff
nseq
nslookup
ntp_adjtime
ntp_gettime
nvi
nview
objcopy
objdump
objformat
ocsp
od
onintr
open
openssl
opieaccess
opieinfo
opiekey
opiekeys
opiepasswd
option
options
oqmgr
pack
package
packagens
pagesize
palette
pam_auth
panedwindow
parray
passwd
paste
patch
pathchk
pathconf
pawd
pax
pbm
pcre
pcreapi
pcrebuild
pcrecallout
pcrecompat
pcrecpp
pcregrep
pcrematching
pcrepartial
pcrepattern
pcreperform
pcreposix
pcreprecompile
pcresample
pcretest
perl
perl56delta
perl58delta
perl561delta
perl570delta
perl571delta
perl572delta
perl573delta
perl581delta
perl582delta
perl583delta
perl584delta
perl585delta
perl586delta
perl587delta
perl588delta
perl5004delta
perl5005delta
perlaix
perlamiga
perlapi
perlapio
perlapollo
perlartistic
perlbeos
perlbook
perlboot
perlbot
perlbs2000
perlbug
perlcall
perlcc
perlce
perlcheat
perlclib
perlcn
perlcompile
perlcygwin
perldata
perldbmfilter
perldebguts
perldebtut
perldebug
perldelta
perldgux
perldiag
perldoc
perldos
perldsc
perlebcdic
perlembed
perlepoc
perlfaq
perlfaq1
perlfaq2
perlfaq3
perlfaq4
perlfaq5
perlfaq6
perlfaq7
perlfaq8
perlfaq9
perlfilter
perlfork
perlform
perlfreebsd
perlfunc
perlglossary
perlgpl
perlguts
perlhack
perlhist
perlhpux
perlhurd
perlintern
perlintro
perliol
perlipc
perlirix
perlivp
perljp
perlko
perllexwarn
perllinux
perllocale
perllol
perlmachten
perlmacos
perlmacosx
perlmint
perlmod
perlmodinstall
perlmodlib
perlmodstyle
perlmpeix
perlnetware
perlnewmod
perlnumber
perlobj
perlop
perlopenbsd
perlopentut
perlos2
perlos390
perlos400
perlothrtut
perlpacktut
perlplan9
perlpod
perlpodspec
perlport
perlqnx
perlre
perlref
perlreftut
perlrequick
perlreref
perlretut
perlrun
perlsec
perlsolaris
perlstyle
perlsub
perlsyn
perlthrtut
perltie
perltoc
perltodo
perltooc
perltoot
perltrap
perltru64
perltw
perlunicode
perluniintro
perlutil
perluts
perlvar
perlvmesa
perlvms
perlvos
perlwin32
perlxs
perlxstut
perror
pfbtops
pftp
pgrep
phones
photo
pic
pickup
piconv
pid
pipe
pkcs7
pkcs8
pkcs12
pkg_add
pkg_check
pkg_create
pkg_delete
pkg_info
pkg_sign
pkg_version
pkill
pl2pm
place
pod2html
pod2latex
pod2man
pod2text
pod2usage
podchecker
podselect
poll
popd
popup
posix_madvise
postalias
postcat
postconf
postdrop
postfix
postkick
postlock
postlog
postmap
postqueue
postsuper
pr
pread
preadv
printcap
printenv
printf
proc
procfs
profil
protocols
prove
proxymap
ps
psed
psroff
pstruct
ptrace
publickey
pushd
puts
pwd
pwrite
pwritev
qmgr
qmqpd
quota
quotactl
radiobutton
raise
rand
ranlib
rcp
rcs
rcsclean
rcsdiff
rcsfile
rcsfreeze
rcsintro
rcsmerge
read
readelf
readlink
readonly
readv
realpath
reboot
recv
recvfrom
recvmsg
red
ree
refer
regexp
registry
regsub
rehash
remote
rename
repeat
replace
req
reset
resolver
resource
return
rev
revoke
rfcomm_sppd
rfork
rhosts
ripemd
ripemd160
rlog
rlogin
rm
rmd160
rmdir
rpc
rpcgen
rs
rsa
rsautl
rsh
rtld
rtprio
rup
ruptime
rusers
rwall
rwho
s2p
safe
sasl
sasldblistusers2
saslpasswd2
sbrk
scache
scale
scan
sched
sched_getparam
sched_getscheduler
sched_get_priority_max
sched_get_priority_min
sched_rr_get_interval
sched_setparam
sched_setscheduler
sched_yield
scon
scp
script
scrollbar
sdiff
sed
seek
select
selection
semctl
semget
semop
send
sendbug
sendfile
sendmail
sendmsg
sendto
services
sess_id
set
setegid
setenv
seteuid
setfacl
setgid
setgroups
setitimer
setlogin
setpgid
setpgrp
setpriority
setregid
setresgid
setresuid
setreuid
setrlimit
setsid
setsockopt
settc
settimeofday
setty
setuid
setvar
sftp
sh
sha
sha1
sha256
shar
shells
shift
shmat
shmctl
shmdt
shmget
showq
shutdown
sigaction
sigaltstack
sigblock
sigmask
sigpause
sigpending
sigprocmask
sigreturn
sigsetmask
sigstack
sigsuspend
sigvec
sigwait
size
slapadd
slapcat
slapd
slapdn
slapindex
slappasswd
slaptest
sleep
slogin
slurpd
smbutil
smime
smtp
smtpd
socket
socketpair
sockstat
soelim
sort
source
spawn
speed
spinbox
spkac
splain
split
squid
squid_ldap_auth
squid_ldap_group
squid_unix_group
sscop
ssh
sshd_config
ssh_config
stab
startslip
stat
statfs
stop
string
strings
strip
stty
su
subst
sum
suspend
swapoff
swapon
switch
symlink
sync
sysarch
syscall
sysconftool
sysconftoolcheck
systat
s_client
s_server
s_time
tabs
tail
talk
tar
tbl
tclsh
tcltest
tclvars
tcopy
tcpdump
tcpslice
tcsh
tee
tell
telltc
telnet
term
termcap
terminfo
test
texindex
texinfo
text
textdomain
tfmtodit
tftp
then
threads
time
tip
tk
tkerror
tkvars
tkwait
tlsmgr
tmac
top
toplevel
touch
tput
tr
trace
trafshow
trap
troff
true
truncate
truss
tset
tsort
tty
ttys
type
tzfile
ui
ul
ulimit
umask
unalias
uname
uncomplete
uncompress
undelete
unexpand
unhash
unifdef
unifdefall
uniq
units
unknown
unlimit
unlink
unmount
unset
unsetenv
until
unvis
update
uplevel
uptime
upvar
usbhidaction
usbhidctl
users
utf8
utimes
utmp
utrace
uudecode
uuencode
uuidgen
vacation
variable
verify
version
vfork
vgrind
vgrindefs
vi
vidcontrol
vidfont
view
virtual
vis
vt220keys
vwait
w
wait
wait3
wait4
waitpid
wall
wc
wget
what
whatis
where
whereis
which
while
who
whoami
whois
window
winfo
wish
wm
write
writev
wtmp
x509
xargs
xgettext
xmlwf
xstr
xsubpp
yacc
yes
ypcat
ypchfn
ypchpass
ypchsh
ypmatch
yppasswd
ypwhich
yyfix
zcat
zcmp
zdiff
zegrep
zfgrep
zforce
zgrep
zmore
znew
_exit
__syscall
 
FreeBSD/Linux/UNIX General Commands Manual
Hypertext Man Pages
listbox
 
listbox(n)		     Tk Built-In Commands		    listbox(n)



NAME
       listbox - Create and manipulate listbox widgets

SYNOPSIS
       listbox	pathName ?options?  -activestyle   -height   -selectforeground
       -background    -highlightbackground     -setgrid  -borderwidth	-high-
       lightcolor     -state   -cursor	 -highlightthickness -takefocus  -dis-
       abledforeground -relief	 -width       -exportselection	  -selectback-
       ground	-xscrollcommand  -font	   -selectborderwidth  -yscrollcommand
       -foreground

WIDGET-SPECIFIC OPTIONS
       Specifies the style in which to draw the active element.  This must  be
       one  of	dotbox (show a focus ring around the active element), none (no
       special indication of  active  element)	or  underline  (underline  the
       active  element).   The	default  is  underline.  Specifies the desired
       height for the window, in lines.  If zero or  less,  then  the  desired
       height  for  the  window is made just large enough to hold all the ele-
       ments in the listbox.  Specifies the name of a variable.  The value  of
       the  variable is a list to be displayed inside the widget; if the vari-
       able value changes then the widget will automatically update itself  to
       reflect	the  new value.  Attempts to assign a variable with an invalid
       list value to -listvariable will cause an error.  Attempts to  unset  a
       variable  in  use as a -listvariable will fail but will not generate an
       error.  Specifies one of several styles for manipulating the selection.
       The  value  of  the  option  may be arbitrary, but the default bindings
       expect it to be either single,  browse,	multiple,  or  extended;   the
       default	value is browse.  Specifies one of two states for the listbox:
       normal or disabled.  If the listbox is disabled then items may  not  be
       inserted  or deleted, items are drawn in the -disabledforeground color,
       and selection cannot be modified and is	not  shown  (though  selection
       information  is	retained).  Specifies the desired width for the window
       in characters.  If the font doesn't have a uniform width then the width
       of  the	character ``0'' is used in translating from character units to
       screen units.  If zero or less, then the desired width for  the	window
       is made just large enough to hold all the elements in the listbox.


DESCRIPTION
       The  listbox  command creates a new window (given by the pathName argu-
       ment)  and  makes  it  into  a  listbox	widget.   Additional  options,
       described  above, may be specified on the command line or in the option
       database to configure aspects of the listbox such as its colors,  font,
       text,  and  relief.  The listbox command returns its pathName argument.
       At the time this command is invoked, there  must  not  exist  a	window
       named pathName, but pathName's parent must exist.

       A  listbox  is  a widget that displays a list of strings, one per line.
       When first created, a new listbox has no  elements.   Elements  may  be
       added  or  deleted using widget commands described below.  In addition,
       one or more elements may be selected as described below.  If a  listbox
       is  exporting  its selection (see exportSelection option), then it will
       observe the standard X11 protocols for handling the selection.  Listbox
       selections  are	available  as  type STRING; the value of the selection
       will be the text of the selected elements, with newlines separating the
       elements.

       It is not necessary for all the elements to be displayed in the listbox
       window at once;	commands described below may be  used  to  change  the
       view in the window.  Listboxes allow scrolling in both directions using
       the standard xScrollCommand and yScrollCommand options.	They also sup-
       port scanning, as described below.


INDICES
       Many  of  the widget commands for listboxes take one or more indices as
       arguments.  An index specifies a particular element of the listbox,  in
       any of the following ways:

       number	   Specifies  the element as a numerical index, where 0 corre-
		   sponds to the first element in the listbox.

       active	   Indicates the element that has the location	cursor.   This
		   element will be displayed as specified by -activestyle when
		   the listbox has the keyboard focus,	and  it  is  specified
		   with the activate widget command.

       anchor	   Indicates  the anchor point for the selection, which is set
		   with the selection anchor widget command.

       end	   Indicates the end of the listbox.  For most	commands  this
		   refers  to  the  last element in the listbox, but for a few
		   commands such as index and insert it refers to the  element
		   just after the last one.

       @x,y	   Indicates  the element that covers the point in the listbox
		   window specified by x and y (in pixel coordinates).	If  no
		   element covers that point, then the closest element to that
		   point is used.

       In the widget command descriptions below, arguments named index, first,
       and last always contain text indices in one of the above forms.


WIDGET COMMAND
       The  listbox  command creates a new Tcl command whose name is pathName.
       This command may be used to invoke various operations  on  the  widget.
       It  has	the  following	general  form:	pathName  option ?arg arg ...?
       Option and the args determine the exact behavior of the	command.   The
       following commands are possible for listbox widgets:

       pathName activate index
	      Sets the active element to the one indicated by index.  If index
	      is outside the range of elements in the listbox then the closest
	      element  is activated.  The active element is drawn as specified
	      by -activestyle when the widget has the  input  focus,  and  its
	      index may be retrieved with the index active.

       pathName bbox index
	      Returns  a  list	of four numbers describing the bounding box of
	      the text in the element given by index.  The first two  elements
	      of  the list give the x and y coordinates of the upper-left cor-
	      ner of the screen area covered by the text (specified in	pixels
	      relative to the widget) and the last two elements give the width
	      and height of the area, in pixels.  If no part  of  the  element
	      given by index is visible on the screen, or if index refers to a
	      non-existent element, then the result is an  empty  string;   if
	      the element is partially visible, the result gives the full area
	      of the element, including any parts that are not visible.

       pathName cget option
	      Returns the current value of the configuration option  given  by
	      option.  Option may have any of the values accepted by the list-
	      box command.

       pathName configure ?option? ?value option value ...?
	      Query or modify the configuration options of the widget.	If  no
	      option is specified, returns a list describing all of the avail-
	      able options for pathName (see Tk_ConfigureInfo for  information
	      on  the  format  of  this list).	If option is specified with no
	      value, then the command returns a list describing the one  named
	      option (this list will be identical to the corresponding sublist
	      of the value returned if no option is  specified).   If  one  or
	      more option-value pairs are specified, then the command modifies
	      the given widget option(s) to have the given value(s);  in  this
	      case  the  command returns an empty string.  Option may have any
	      of the values accepted by the listbox command.

       pathName curselection
	      Returns a list containing the numerical indices of  all  of  the
	      elements	in  the listbox that are currently selected.  If there
	      are no elements selected in the listbox then an empty string  is
	      returned.

       pathName delete first ?last?
	      Deletes one or more elements of the listbox.  First and last are
	      indices specifying the first and last elements in the  range  to
	      delete.	If  last  isn't specified it defaults to first, i.e. a
	      single element is deleted.

       pathName get first ?last?
	      If last is omitted, returns the contents of the listbox  element
	      indicated by first, or an empty string if first refers to a non-
	      existent element.  If last is specified, the command  returns  a
	      list  whose  elements  are  all  of the listbox elements between
	      first and last, inclusive.  Both first and last may have any  of
	      the standard forms for indices.

       pathName index index
	      Returns  the  integer index value that corresponds to index.  If
	      index is end the return value is a count of the number  of  ele-
	      ments in the listbox (not the index of the last element).

       pathName insert index ?element element ...?
	      Inserts  zero  or  more new elements in the list just before the
	      element given by index.  If index is specified as end  then  the
	      new elements are added to the end of the list.  Returns an empty
	      string.

       pathName itemcget index option
	      Returns the current value of the item configuration option given
	      by  option.  Option  may	have any of the values accepted by the
	      listbox itemconfigure command.

       pathName itemconfigure index ?option? ?value? ?option value ...?
	      Query or modify the configuration options  of  an  item  in  the
	      listbox.	 If  no option is specified, returns a list describing
	      all of the available options for the item (see  Tk_ConfigureInfo
	      for information on the format of this list).  If option is spec-
	      ified with no value, then the command returns a list  describing
	      the  one named option (this list will be identical to the corre-
	      sponding sublist of the value returned if no  option  is	speci-
	      fied).   If  one	or more option-value pairs are specified, then
	      the command modifies the given  widget  option(s)  to  have  the
	      given  value(s);	 in  this  case  the  command returns an empty
	      string. The following options are currently supported for items:

	      -background color
		     Color specifies the background color to use when display-
		     ing the item. It may have any of the  forms  accepted  by
		     Tk_GetColor.

	      -foreground color
		     Color specifies the foreground color to use when display-
		     ing the item. It may have any of the  forms  accepted  by
		     Tk_GetColor.

	      -selectbackground color
		     color specifies the background color to use when display-
		     ing the item while it is selected. It may have any of the
		     forms accepted by Tk_GetColor.

	      -selectforeground color
		     color specifies the foreground color to use when display-
		     ing the item while it is selected. It may have any of the
		     forms accepted by Tk_GetColor.

       pathName nearest y
	      Given  a	y-coordinate  within  the listbox window, this command
	      returns the index of the (visible) listbox  element  nearest  to
	      that y-coordinate.

       pathName scan option args
	      This command is used to implement scanning on listboxes.	It has
	      two forms, depending on option:

	      pathName scan mark x y
		     Records x and y and the current view in the listbox  win-
		     dow;   used  in  conjunction  with later scan dragto com-
		     mands.  Typically this command is associated with a mouse
		     button  press in the widget.  It returns an empty string.

	      pathName scan dragto x y.
		     This command computes the difference between its x and  y
		     arguments and the x and y arguments to the last scan mark
		     command for the widget.  It then adjusts the view	by  10
		     times  the  difference  in  coordinates.  This command is
		     typically associated with mouse motion events in the wid-
		     get,  to  produce the effect of dragging the list at high
		     speed through the window.	The return value is  an  empty
		     string.

       pathName see index
	      Adjust  the  view  in  the  listbox so that the element given by
	      index is visible.  If the element is already  visible  then  the
	      command  has  no	effect; if the element is near one edge of the
	      window then the listbox scrolls to bring the element  into  view
	      at  the  edge;  otherwise the listbox scrolls to center the ele-
	      ment.

       pathName selection option arg
	      This command is used to adjust the selection within  a  listbox.
	      It has several forms, depending on option:

	      pathName selection anchor index
		     Sets  the selection anchor to the element given by index.
		     If index refers to a non-existent element, then the clos-
		     est  element is used.  The selection anchor is the end of
		     the selection that is fixed while dragging out  a	selec-
		     tion  with  the  mouse.   The index anchor may be used to
		     refer to the anchor element.

	      pathName selection clear first ?last?
		     If any of the elements between first and last (inclusive)
		     are  selected,  they are deselected.  The selection state
		     is not changed for elements outside this range.

	      pathName selection includes index
		     Returns 1 if the element indicated by index is  currently
		     selected, 0 if it isn't.

	      pathName selection set first ?last?
		     Selects  all  of  the elements in the range between first
		     and last,	inclusive,  without  affecting	the  selection
		     state of elements outside that range.

       pathName size
	      Returns a decimal string indicating the total number of elements
	      in the listbox.

       pathName xview args
	      This command is used to query and change the horizontal position
	      of  the  information in the widget's window.  It can take any of
	      the following forms:

	      pathName xview
		     Returns a list containing two elements.  Each element  is
		     a	real fraction between 0 and 1;	together they describe
		     the horizontal span that is visible in the  window.   For
		     example,  if  the first element is .2 and the second ele-
		     ment is .6, 20% of the listbox's text  is	off-screen  to
		     the  left,  the  middle 40% is visible in the window, and
		     40% of the text is off-screen to the  right.   These  are
		     the same values passed to scrollbars via the -xscrollcom-
		     mand option.

	      pathName xview index
		     Adjusts the view in the  window  so  that	the  character
		     position  given by index is displayed at the left edge of
		     the window.  Character positions are defined by the width
		     of the character 0.

	      pathName xview moveto fraction
		     Adjusts  the  view  in the window so that fraction of the
		     total width of the listbox  text  is  off-screen  to  the
		     left.  fraction must be a fraction between 0 and 1.

	      pathName xview scroll number what
		     This  command shifts the view in the window left or right
		     according to number and what.  Number must be an integer.
		     What  must be either units or pages or an abbreviation of
		     one of these.  If what is units, the view adjusts left or
		     right by number character units (the width of the 0 char-
		     acter) on the display;  if it  is	pages  then  the  view
		     adjusts by number screenfuls.  If number is negative then
		     characters farther to the left become visible;  if it  is
		     positive then characters farther to the right become vis-
		     ible.

       pathName yview ?args?
	      This command is used to query and change the  vertical  position
	      of the text in the widget's window.  It can take any of the fol-
	      lowing forms:

	      pathName yview
		     Returns a list containing two elements, both of which are
		     real  fractions between 0 and 1.  The first element gives
		     the position of the listbox element at  the  top  of  the
		     window,  relative to the listbox as a whole (0.5 means it
		     is halfway through the listbox, for example).  The second
		     element  gives  the  position of the listbox element just
		     after the last one in the window, relative to the listbox
		     as  a whole.  These are the same values passed to scroll-
		     bars via the -yscrollcommand option.

	      pathName yview index
		     Adjusts the view in the window so that the element  given
		     by index is displayed at the top of the window.

	      pathName yview moveto fraction
		     Adjusts  the view in the window so that the element given
		     by fraction appears at the top of the  window.   Fraction
		     is  a  fraction  between  0 and 1;  0 indicates the first
		     element in the listbox, 0.33 indicates the  element  one-
		     third the way through the listbox, and so on.

	      pathName yview scroll number what
		     This  command  adjusts  the view in the window up or down
		     according to number and what.  Number must be an integer.
		     What  must  be  either units or pages.  If what is units,
		     the view adjusts up or down by number lines;   if	it  is
		     pages  then  the  view  adjusts by number screenfuls.  If
		     number is negative then earlier elements become  visible;
		     if it is positive then later elements become visible.


DEFAULT BINDINGS
       Tk  automatically  creates  class bindings for listboxes that give them
       Motif-like behavior.  Much of the behavior of a listbox	is  determined
       by  its	selectMode  option,  which selects one of four ways of dealing
       with the selection.

       If the selection mode is single or browse, at most one element  can  be
       selected  in  the listbox at once.  In both modes, clicking button 1 on
       an element selects it and deselects any other selected item.  In browse
       mode it is also possible to drag the selection with button 1.

       If  the	selection mode is multiple or extended, any number of elements
       may be selected at once, including discontiguous ranges.   In  multiple
       mode, clicking button 1 on an element toggles its selection state with-
       out affecting any other elements.  In extended mode, pressing button  1
       on  an  element	selects  it,  deselects  everything else, and sets the
       anchor to the element under the mouse;  dragging the mouse with	button
       1  down	extends  the selection to include all the elements between the
       anchor and the element under the mouse, inclusive.

       Most people will probably want to use browse mode for single selections
       and extended mode for multiple selections; the other modes appear to be
       useful only in special situations.

       Any time the selection  changes	in  the  listbox,  the	virtual  event
       <>  will	be  generated.	 It is easiest to bind to this
       event to be made aware of any changes to listbox selection.

       In addition to the above behavior, the following additional behavior is
       defined by the default bindings:

       [1]    In extended mode, the selected range can be adjusted by pressing
	      button 1 with the Shift key down:  this modifies	the  selection
	      to  consist  of  the elements between the anchor and the element
	      under the mouse, inclusive.  The un-anchored  end  of  this  new
	      selection can also be dragged with the button down.

       [2]    In  extended  mode,  pressing button 1 with the Control key down
	      starts a toggle operation: the anchor  is  set  to  the  element
	      under  the  mouse,  and  its  selection  state is reversed.  The
	      selection state of other elements isn't changed.	If  the  mouse
	      is  dragged  with button 1 down, then the selection state of all
	      elements between the anchor and the element under the  mouse  is
	      set to match that of the anchor element;	the selection state of
	      all other elements remains what it was before the toggle	opera-
	      tion began.

       [3]    If  the  mouse leaves the listbox window with button 1 down, the
	      window scrolls away from the mouse, making  information  visible
	      that  used  to  be  off-screen  on  the  side of the mouse.  The
	      scrolling continues until the mouse re-enters  the  window,  the
	      button is released, or the end of the listbox is reached.

       [4]    Mouse  button  2 may be used for scanning.  If it is pressed and
	      dragged over the listbox, the contents of the  listbox  drag  at
	      high speed in the direction the mouse moves.

       [5]    If  the  Up  or Down key is pressed, the location cursor (active
	      element) moves up or down one element.  If the selection mode is
	      browse  or extended then the new active element is also selected
	      and all other elements are deselected.  In extended mode the new
	      active element becomes the selection anchor.

       [6]    In extended mode, Shift-Up and Shift-Down move the location cur-
	      sor (active element) up or down one element and also extend  the
	      selection  to that element in a fashion similar to dragging with
	      mouse button 1.

       [7]    The Left and Right keys scroll the listbox view left  and  right
	      by the width of the character 0.	Control-Left and Control-Right
	      scroll the listbox view left and right by the width of the  win-
	      dow.   Control-Prior and Control-Next also scroll left and right
	      by the width of the window.

       [8]    The Prior and Next keys scroll the listbox view up and  down  by
	      one page (the height of the window).

       [9]    The  Home  and  End  keys scroll the listbox horizontally to the
	      left and right edges, respectively.

       [10]   Control-Home sets the location cursor to the  first  element  in
	      the listbox, selects that element, and deselects everything else
	      in the listbox.

       [11]   Control-End sets the location cursor to the last element in  the
	      listbox,	selects that element, and deselects everything else in
	      the listbox.

       [12]   In extended mode, Control-Shift-Home extends  the  selection  to
	      the  first  element in the listbox and Control-Shift-End extends
	      the selection to the last element.

       [13]   In multiple mode, Control-Shift-Home moves the  location	cursor
	      to  the first element in the listbox and Control-Shift-End moves
	      the location cursor to the last element.

       [14]   The space and Select keys make a selection at the location  cur-
	      sor  (active element) just as if mouse button 1 had been pressed
	      over this element.

       [15]   In extended mode, Control-Shift-space  and  Shift-Select	extend
	      the selection to the active element just as if button 1 had been
	      pressed with the Shift key down.

       [16]   In extended mode, the Escape key cancels the most recent	selec-
	      tion  and  restores  all	the  elements in the selected range to
	      their previous selection state.

       [17]   Control-slash selects everything in the widget, except in single
	      and  browse  modes,  in which case it selects the active element
	      and deselects everything else.

       [18]   Control-backslash deselects everything in the widget, except  in
	      browse mode where it has no effect.

       [19]   The  F16	key (labelled Copy on many Sun workstations) or Meta-w
	      copies the selection in the widget to the clipboard, if there is
	      a selection.


       The  behavior  of listboxes can be changed by defining new bindings for
       individual widgets or by redefining the class bindings.


KEYWORDS
       listbox, widget



Tk				      8.4			    listbox(n)
=2318
+602
(213)