org.gnu.gtk
Class ToggleButton
public class ToggleButton
A ToggleButton is a button that changes and retains its on or off state each
time it is selected with the mouse. When in the on state, it will appear to
be pressed in.
ToggleButton() - Creates a new toggle button.
|
ToggleButton(Handle handle) - Construct a toggle button using a handle to a native resource.
|
ToggleButton(String label, boolean hasMnemonic) - Creates a new toggle button with a text label.
|
addListener , click , enter , getButton , getEventListenerClass , getEventType , getFocusOnClick , getImage , getLabel , getRelief , getType , getUseStock , getUseUnderline , getXAlignment , getYAlignment , leave , press , release , removeListener , setAlignment , setFocusOnClick , setImage , setLabel , setRelief , setUseStock , setUseUnderline |
add , addListener , getBorderWidth , getChildren , getEventListenerClass , getEventType , getResizeMode , getType , remove , removeListener , resizeChildren , setBorderWidth , setResizeMode |
activate , addAccelerator , addEvents , addListener , addListener , addListener , addListener , addListener , addListener , addListener , addListener , addListener , addListener , addListener , canActivateAccel , createContext , createLayout , draw , drawArea , drawArea , finish , getAccessible , getAllocation , getCanFocus , getColormap , getContext , getData , getDisplay , getDragData , getEventListenerClass , getEventType , getExtensionEvents , getModifierStyle , getName , getParent , getParentWindow , getPointer , getRootWindow , getScreen , getSensitive , getStyle , getToplevel , getType , getWidget , getWindow , grabDefault , grabFocus , hasFocus , hasScreen , hide , hideAll , highlight , highlight , intersect , isAncestor , makeWidget , modifyStyle , popColormap , pushColormap , realize , removeAccelerator , removeListener , removeListener , removeListener , removeListener , removeListener , removeListener , removeListener , removeListener , removeListener , removeListener , removeListener , reparent , setBackgroundColor , setBaseColor , setCanFocus , setColormap , setDoubleBuffered , setDragDestination , setDragIcon , setDragIconPixbuf , setDragIconStock , setDragSource , setEvents , setExtensionEvents , setFont , setForegroundColor , setMinimumSize , setName , setNoDragDestination , setNoDragSource , setSensitive , setTextColor , shapeCombineMask , show , showAll , unHighlight , unHighlight |
addEventHandler , addEventHandler , addEventHandler , addEventHandler , addEventHandler , addEventHandler , addEventHandler , addListener , collect , freezeNotify , getBooleanProperty , getData , getDoubleProperty , getEventListenerClass , getEventType , getFloatProperty , getGObjectFromHandle , getIntProperty , getJavaObjectProperty , getLongProperty , getPixbufProperty , getProperty , getStringProperty , hasProperty , notify , removeEventHandler , removeListener , setBooleanProperty , setData , setDoubleProperty , setFloatProperty , setIntProperty , setJavaObjectProperty , setLongProperty , setPixbufProperty , setProperty , setStringProperty , thawNotify |
ToggleButton
public ToggleButton()
Creates a new toggle button.
ToggleButton
public ToggleButton(Handle handle)
Construct a toggle button using a handle to a native resource.
ToggleButton
public ToggleButton(String label,
boolean hasMnemonic)
Creates a new toggle button with a text label. If the hasMnemonic Label
is set, the button is assumes to contain mnemonic characters; that is
characters which are preceeded by an underscore. These will appear
underlined and will be used as keyboard accelerators.
label
- The text to be displayed on the buttonhasMnemonic
- If true, keyboeard accelerators will be interpreted.
addListener
public void addListener(ToggleListener listener)
Register an object to handle button events.
getInconsistent
public boolean getInconsistent()
Return whether this is in the inconsistent state
- True if the 'inbetween' state is in use
getState
public boolean getState()
Returns the state of the toggle button
- True if the button is on or 'pressed in'.
getToggleButton
public static ToggleButton getToggleButton(Handle handle)
Internal static factory method to be used by Java-Gnome only.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
- getType in interface Button
removeListener
public void removeListener(ToggleListener listener)
Removes a listener
setInconsistent
public void setInconsistent(boolean isInconsistent)
Determines whether the toggle button should be in the half-on, or
inconsistent state. This is envirely a visual setting - changes to this
will not affect the state of the button as returned by
getState()
.
isInconsistent
- If true, the button will appear in the in-between state.
setState
public void setState(boolean state)
Modifies the state of the toggle button
state
- If true, the button is in the 'on', or 'pressed in' state.