|
java-gnome version 4.0.15 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.freedesktop.bindings.Pointer
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.ToolItem
org.gnome.gtk.ToolButton
org.gnome.gtk.ToggleToolButton
public class ToggleToolButton
A ToggleToolButton is a ToolButton that retains its state.
The usual usage of such kind of ToolButtons is to let users enable or disable an application feature.
You can check the current state of the ToggleToolButton using the
getActive()
method. Additionally you can connect to the
TOGGLED
signal to respond to changes in
the active state.
Beware that ToogleToolButtons have sometimes fared poorly in usability tests. The problem is that they are an exception: most ToolItems are ToolButtons, and most of them you just press and something immediately happens. Since there is no visual distinction between a ToolButton and an inactive ToggleToolButton, users don't expect that this particular ToolItem is going to behave differently and maintain its state. It's not a huge problem (ie, if the user is paying attention they'll soon find out that the button is a toggle), but it's something that usually takes a few iterations before the user learns. Something to keep in mind.
Nested Class Summary | |
---|---|
static interface |
ToggleToolButton.Toggled
Signal indicating the ToggleToolButton state has changed. |
Nested classes/interfaces inherited from class org.gnome.gtk.ToolButton |
---|
ToolButton.Clicked |
Nested classes/interfaces inherited from class org.gnome.gtk.Widget |
---|
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.EnterNotifyEvent, Widget.ExposeEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.UnmapEvent, Widget.VisibilityNotifyEvent |
Constructor Summary | |
---|---|
ToggleToolButton()
Create a new ToggleToolButton. |
|
ToggleToolButton(Stock stock)
Create a new ToggleToolButton based on one of the stock items. |
Method Summary | |
---|---|
void |
connect(ToggleToolButton.Toggled handler)
Connect a handler to the ToggleToolButton.Toggled signal. |
boolean |
getActive()
Is the ToggleToolButton currently activated on? |
void |
setActive(boolean isActive)
Set whether this ToggleToolButton is active, that is, whether it appears pressed or not. |
Methods inherited from class org.gnome.gtk.ToolButton |
---|
connect, getLabel, getLabelWidget, setLabel, setLabelWidget |
Methods inherited from class org.gnome.gtk.ToolItem |
---|
getExpand, setExpand |
Methods inherited from class org.gnome.gtk.Bin |
---|
getChild |
Methods inherited from class org.gnome.gtk.Container |
---|
add, getChildren, remove, setBorderWidth |
Methods inherited from class org.gnome.gtk.Widget |
---|
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getRequisition, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll |
Methods inherited from class org.freedesktop.bindings.Pointer |
---|
toString |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ToggleToolButton()
public ToggleToolButton(Stock stock)
Method Detail |
---|
public void connect(ToggleToolButton.Toggled handler)
ToggleToolButton.Toggled
signal.
public boolean getActive()
public void setActive(boolean isActive)
TOGGLED
signal.
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |