org.gnu.gtk

Class Combo

public class Combo extends HBox

Deprecated:

The Combo box displays a single item and provides a pull-down list of items that can be selected. The drop-down list is displayed when the user clicks on a small arrow button to the right of the entry field.

By default, the user can step through the items in the list by using the arrow keys, though this behavior can be turned off with the setUseArrows() method.

Normally the arrow keys are only active when the contents of the text entry field matches on of the items in the list. If the contents of the entry field do not match any of the items in the list items, then pressing the arrow keys does nothing. However, by calling the setUseArrowsAlways() method you can specify that the arrow keys be active always.

Constructor Summary
Combo()
Construct a new Combo widget.
Combo(Handle handle)
Construct a new Combo from a handle to a native resource.
Method Summary
voiddisableActivate()
Stops the Combo widget from showing the popup list when the Entry emits the "activate" signal, i.e., when the return key is pressed.
EntrygetEntry()
Get the Entry field that is a part of this combo.
StringgetText()
Retrieve the text from the combo.
static TypegetType()
Retrieve the runtime type used by the GLib library.
voidsetCaseSensitive(boolean val)
Specifies whether the text entered into the Entry field and the text in the line items are case sensitive.
voidsetItemString(Item item, String itemValue)
Sets the string to place in the Entry field when a particular item is selected.
voidsetPopupdownStrings(String[] values)
Convenience method to set all of the items in the popupdown list.
voidsetUseArrorwsAlways(boolean val)
Specifies if the arrow keys will still work even if the current contents of the Entry field do not match any of the items in the list.
voidsetUseArrows(boolean val)
Specifies if the arrow (cursor) keys can be used to step through the items in the list.
voidsetValueInList(boolean val, boolean okifEmpty)
Specifies whether the value entered in the text entry field must match one of the values in the list.

Constructor Detail

Combo

public Combo()
Construct a new Combo widget.

Combo

public Combo(Handle handle)
Construct a new Combo from a handle to a native resource.

Method Detail

disableActivate

public void disableActivate()
Stops the Combo widget from showing the popup list when the Entry emits the "activate" signal, i.e., when the return key is pressed.

getEntry

public Entry getEntry()
Get the Entry field that is a part of this combo.

getText

public String getText()
Retrieve the text from the combo.

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.

setCaseSensitive

public void setCaseSensitive(boolean val)
Specifies whether the text entered into the Entry field and the text in the line items are case sensitive.

This may be useful when you have called setValueInList() to limit the values entered but are not worried about case differences.

setItemString

public void setItemString(Item item, String itemValue)
Sets the string to place in the Entry field when a particular item is selected. This is needed if the list item is not a simple label.

Parameters: item The item to add to the list. itemValue The string value to display in the Entry if item is selected

setPopupdownStrings

public void setPopupdownStrings(String[] values)
Convenience method to set all of the items in the popupdown list.

Parameters: values The array of values to put into the popupdown list.

setUseArrorwsAlways

public void setUseArrorwsAlways(boolean val)
Specifies if the arrow keys will still work even if the current contents of the Entry field do not match any of the items in the list.

Parameters: val true if the arrows should still work.

setUseArrows

public void setUseArrows(boolean val)
Specifies if the arrow (cursor) keys can be used to step through the items in the list. This is on by default.

Parameters: val true if the arrow keys can be used to step through the items in the list.

setValueInList

public void setValueInList(boolean val, boolean okifEmpty)
Specifies whether the value entered in the text entry field must match one of the values in the list. If this is set then the user will not be able to perform any other action until a valid value has been entered.

Parameters: val true if the value entered must match one of the values in the list. okifEmpty true if an empty value is considered valid.