org.gnome.gtk
Class ToggleButton
java.lang.Object
org.freedesktop.bindings.Proxy
org.gnome.glib.Object
org.gnome.gtk.Object
org.gnome.gtk.Widget
org.gnome.gtk.Container
org.gnome.gtk.Bin
org.gnome.gtk.Button
org.gnome.gtk.ToggleButton
- Direct Known Subclasses:
- CheckButton
public class ToggleButton
- extends Button
A ToggleButton is a Button which retains its state.
- Since:
- 4.0.3
- Author:
- Sebastian Mancke, Andrew Cowie
|
Nested Class Summary |
static interface |
ToggleButton.TOGGLED
Signal indicating the Button has changed state. |
| Nested classes/interfaces inherited from class org.gnome.gtk.Widget |
Widget.BUTTON_PRESS_EVENT, Widget.BUTTON_RELEASE_EVENT, Widget.ENTER_NOTIFY_EVENT, Widget.EXPOSE_EVENT, Widget.FOCUS_IN_EVENT, Widget.FOCUS_OUT_EVENT, Widget.HIDE, Widget.KEY_PRESS_EVENT, Widget.KEY_RELEASE_EVENT, Widget.LEAVE_NOTIFY_EVENT, Widget.UNMAP_EVENT, Widget.VISIBILITY_NOTIFY_EVENT |
|
Constructor Summary |
ToggleButton()
Constructs a new ToggleButton |
ToggleButton(java.lang.String label)
Constructs a new ToggleButton with a label. |
| Methods inherited from class org.gnome.gtk.Button |
connect, emitClicked, getAlignmentX, getAlignmentY, getImage, getLabel, getRelief, setAlignment, setImage, setLabel, setRelief |
| Methods inherited from class org.gnome.gtk.Bin |
getChild |
| Methods inherited from class org.gnome.gtk.Widget |
activate, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getHasFocus, getParent, getRequisition, getToplevel, getWindow, grabFocus, hide, modifyBackground, modifyText, setCanFocus, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll |
| Methods inherited from class org.freedesktop.bindings.Proxy |
toString |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ToggleButton
public ToggleButton()
- Constructs a new ToggleButton
ToggleButton
public ToggleButton(java.lang.String label)
- Constructs a new ToggleButton with a label.
The label may contain underscores (
_) to indicate
the mnemonic for the Button.
connect
public void connect(ToggleButton.TOGGLED handler)
getActive
public boolean getActive()
- Returns the current state of the ToggleButton
- Returns:
- returns
true if the ToggleButton is pressed,
false otherwise
setActive
public void setActive(boolean active)
- Set the state of the ToggleButon.
- Parameters:
active - The new state of the ToggleButton