public class ComboBoxText extends ComboBox
Usage is very straight forward:
combo = new TextComboBox(); combo.appendText("SYD"); combo.appendText("YYZ"); combo.appendText("JFK"); combo.appendText("LHR"); ...You can still use the
getActive()
from
ComboBox, but for simple lists of Strings being displayed be this Widget,
the String specific getActiveText()
that is
introduced here is probably what you want.ComboBox.Changed
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.Destroy, Widget.Draw, Widget.EnterNotifyEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.QueryTooltip, Widget.ScrollEvent, Widget.SizeAllocate, Widget.UnmapEvent, Widget.VisibilityNotifyEvent
Constructor and Description |
---|
ComboBoxText()
Construct a new text-only ComboBox.
|
Modifier and Type | Method and Description |
---|---|
void |
appendText(String text)
Append an item to the list.
|
String |
getActiveText()
Returns the text of the active item.
|
void |
insertText(int position,
String text)
Append an item at the supplied position.
|
void |
prependText(String text)
Prepend an item to the beginning of the list.
|
void |
removeText(int position)
Removes the item at given position from the list.
|
void |
setModel(TreeModel model)
Unsupported.
|
connect, getActive, getActiveIter, popdown, popup, setActive, setActiveIter
add, getChildren, remove, setBorderWidth
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, destroy, getAllocatedHeight, getAllocatedWidth, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getPreferredHeightForWidthMinimum, getPreferredHeightForWidthNatural, getPreferredHeightMinimum, getPreferredHeightNatural, getPreferredWidthForHeightMinimum, getPreferredWidthForHeightNatural, getPreferredWidthMinimum, getPreferredWidthNatural, getRequestMode, getRequisition, getSensitive, getStyleContext, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, overrideBackground, overrideColor, overrideFont, queueDraw, queueDrawArea, realize, setAlignHorizontal, setAlignVertical, setCanDefault, setCanFocus, setEvents, setExpandHorizontal, setExpandVertical, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
public ComboBoxText()
public void appendText(String text)
public String getActiveText()
public void insertText(int position, String text)
public void prependText(String text)
public void removeText(int position)
public void setModel(TreeModel model)
If you're using a text mode ComboBox, GTK internally allocates a ListStore of a certain structure and the methods are designed to work against it. Things will blow up if you swap it for something different, unless it had exactly the correct signature. As this signature is not something that is part of the GTK API, it is not something we're going to expose; this override is here to prevent you from shooting yourself in the foot.