=head1 NAME

ComboBox - a ComboBox widget for Tk4.0

=head1 SYNOPSIS

C<ComboBox I<pathName> I<?options?> >

=head1 DESCRIPTION

This Tcl code implements a basic ComboBox widget for Tk4.0. The clever bit 
is  that you can access the widget's internals just like you would any 
other Tk4.0 widget (well, almost :-). This is accomplished by creating a new proc 
with the same name as the widget. This proc lets the programmer do 
things like "<widget-name> configure" and <widget-name> cget" and so on.

I have borrowed (isn't that the Tcl way ?) some code from Ioi's excellent
Tix widget set and some stuff from Zircon. I wrote this widget because
I didn't want to add yet another extension to my interpreter and 
I preffered something done entirely in Tcl.

For a quick demo run the program ComboBox.test

=head1 STANDARD OPTIONS

=over 1

Most standard options like font, fg, bg, cursor, highlightthickness, etc.
are supported. The switches are named differently though since
we have multiple underlying widgets. Read on.

=head1 WIDGET-SPECIFIC OPTIONS

=over 1

These options are currently supported by the ComboBox widget.

=item -efont (entry widgets font) 

=item -efg (entry widgets foreground color)

=item -ebg (entry widgets background color)

=item -ebd (entry widgets border width)

=item -ehighlightthickness (entry widgets highlight thickness)

=item -erelief (entry widgets relief)

=item -ewidth (entry widgets width)

=item -lblfont (entry widgets font)

=item -lblfg (entry widgets foreground color)

=item -lblbg (entry widgets background color)

=item -lblbd (entry widgets border width)

=item -lbltext (entry widgets text)

=item -lblrelief (entry widgets relief)

=item -listfont (entry widgets font)

=item -listfg (entry widgets foreground color)

=item -listbg (entry widgets background color)

=item -listbd (entry widgets border width)

=item -listrelief (entry widgets relief)

=item -listwidth (entry widgets width)

=item -listheight (entry widgets height)

=item -cursor (cursor for all underlying widgets)

=item -strict (strict mode)

=head1 WIDGET COMMAND

The ComboBox command creates a new Tcl command whose name 
is I<pathName>. This command is used to invoke various operations 
on the widget. It has the following general form :

I<pathName option ?arg arg ...?>

I<option> and the I<arg>s determine the exact behaviour of the command.
The following commands are currently supported by the ComboBox widget:

=item I<pathName> add I<args>

Adds zero or more new elements to the list. Elements are
added at the end !! This will go away soon !

=item I<pathName> cget I<option>

Returns the current value of the configuration option given
by I<option>. All the widget specific options listed above 
can be queried with this command.

=item I<pathName> clear

Clears the entry widget.

=item I<pathName> del I<first> I<?last?>

Deletes one or more elements of the list. I<first> and I<last>
are indices specifying the range of elements to delete. If I<last> 
isn't specified, only one element is deleted.

=item I<pathName> configure I<?option? ?value option value ...?>

Modify any of the widget specific configuration options 
listed above. This command cannot be used to query the
value of the option ! Use I<pathName cget> instead.


=head1 EXAMPLES

=over 1

# Use auto_path or loadlibindex or just source in the code
source ComboBox.tcl

C<ComboBox .cbox -ewidth 15 -listheight 6 -lbltext "Demo" -ehighlightthickness 0 -ebg AliceBlue -efg DarkSlateBlue -strict 1 -listwidth 4>

 .cbox add "foo bar" "foo ugh" "foo bar ugh"

 .cbox set foobarugh
 .cbox configure -listfg green4 -listbg azure2

puts "ComboBox contains value [.cbox get]"

=head1 AUTHORS

Ashutosh Joglekar, Nov 21 1995, ashutosh@panix.com OR ajogleka@ltcm.com

=head1 NOTES

The ComboBox does a grab on the global focus !

=head1 KEYWORDS

ComboBox, widget, options, listbox, entry, wm

