|
java-gnome version 4.0.19 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
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
public class ToolButton
A ToolButton is a ToolItem that displays as a graphical Button.
This is the item you will want to add in most cases to your application Toolbar(s). It is a acts a like a normal Button, but its appearance is designed to look better on a Toolbar.
A ToolButton has an image or icon and a Label. The user Toolbar preferences determine whether the Label is actually shown on screen. Even if you disable the Label in your desktop preferences, you should provide a valid Label to your application ToolButtons, as other users will have them showing and your program will look a bit silly without textual labels.
Nested Class Summary | |
---|---|
static interface |
ToolButton.Clicked
Signal generated when a user presses and releases a ToolButton, causing it to activate. |
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 |
Nested classes/interfaces inherited from class org.gnome.gtk.Object |
---|
Object.Destroy |
Constructor Summary | |
---|---|
ToolButton(Stock stock)
Creates a new stock ToolButton. |
|
ToolButton(Widget iconWidget,
String label)
Creates a new ToolButton using the given icon and Label. |
Method Summary | |
---|---|
void |
connect(ToolButton.Clicked handler)
Connect a handler to the ToolButton.Clicked signal. |
String |
getLabel()
Get the text Label previously set with setLabel() . |
Widget |
getLabelWidget()
Get the Widget used as "label", if any. |
void |
setLabel(String label)
Set the Label of the Button. |
void |
setLabelWidget(Widget labelWidget)
Set the Widget to be used as the "label" for this ToolButton. |
Methods inherited from class org.gnome.gtk.ToolItem |
---|
getExpand, getRelatedAction, setExpand, setIsImportant, setRelatedAction |
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, getSensitive, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, realize, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll |
Methods inherited from class org.gnome.gtk.Object |
---|
connect, destroy |
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 ToolButton(Stock stock)
stock
- The Stock that will determine the Label and icon on the
ToolButton.public ToolButton(Widget iconWidget, String label)
iconWidget
- The Widget to be used as the icon for the ToolButton.
Usually you will want to use a Widget that displays a
graphic, such as Image
.label
- The Label for the ToolButton.Method Detail |
---|
public void connect(ToolButton.Clicked handler)
ToolButton.Clicked
signal.
public String getLabel()
setLabel()
.
null
if not Label has been set. Note
that a null
return value doesn't mean that the
ToolButton doesn't have a Label, as it can have a Widget Label
or a Label taken from a stock item.public Widget getLabelWidget()
null
if this
ToolButton doesn't have a Widget overriding its label.setLabelWidget(Widget)
public void setLabel(String label)
Note that any value of the Label set by this method won't be actually
displayed if you have set a Widget Label using
setLabelWidget()
label
- The String to be used as Label, or null
.public void setLabelWidget(Widget labelWidget)
Please check setLabel()
before using this,
because in most cases that is what you want.
Usually ToolButtons have either a text Label set with
setLabel()
, or text automatically determined by a stock
item. However, in some cases you will want to provide another kind of
Widget as the label, and this method is how.
labelWidget
- A Widget to be used as a Label, or null
to not
use the Widget Label (in this case, the text Label will be
used. If the text Label is also null
, the
default stock item label is used. In this later case, if
this ToolButton has no stock item, then no Label will be
used at all). Note that if you do pass a non-
null
Widget here, this argument will be used as
the label despite the text in the normal Label or one
generated as a result of using a stock item.
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |