public class ScrolledWindow extends Bin
Some Widgets have built in support for scrolling; in such cases you add
them directly with the usual add() method;
however, if other Widgets need to be enhanced to support scrolling; in such
cases you must nest it inside a Viewport; use
addWithViewport() as a quick way to
achieve this.
This is very poorly named. It is not a subclass of Window; it refers instead to a viewport scrolling around on an underlying canvas.
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 |
|---|
ScrolledWindow()
Construct a ScrolledWindow.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Widget child)
Add a child Widget to this Container.
|
void |
addWithViewport(Widget child)
Create a new Viewport and embeds the child Widget in it before adding
it to the ScrolledWindow.
|
Adjustment |
getHAdjustment()
Get the Adjustment that is being used to drive the horizontal position
of the scroll bar on the bottom edge of this ScrolledWindow.
|
Scrollbar |
getHScrollbar()
Get the Scrollbar Widget that is being used to draw the horizontal
scroll bar on the bottom edge of this ScrolledWindow.
|
int |
getScrollbarSpacing()
Get the amount of spacing being drawn between the Viewport and the
Scrollbars.
|
ShadowType |
getShadowType()
Get the decoration currently set for this ScrolledWindow.
|
Adjustment |
getVAdjustment()
Get the Adjustment that is being used to drive the vertical position of
the scroll bar on the right hand side of this ScrolledWindow.
|
Scrollbar |
getVScrollbar()
Get the Scrollbar Widget that is being used to draw the vertical scroll
bar on the right hand side of this ScrolledWindow.
|
void |
setPolicy(PolicyType hscrollbarPolicy,
PolicyType vscrollbarPolicy)
Set the scrollbar policy for the horizontal and vertical scrollbars.
|
void |
setShadowType(ShadowType type)
Set the type of decoration you want around the child Widget in the
ScrolledWindow.
|
getChildren, remove, setBorderWidthactivate, 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, showAllpublic ScrolledWindow()
public void add(Widget child)
Containerpublic void addWithViewport(Widget child)
add() directly for those
Widgets that do.
As a convienience, calling this method will set the ShadowType of the
created Viewport to NONE, meaning that if you do want a
decoration, you can achieve it in a single place here with a call to
ScrolledWindow's setShadowType().
public Adjustment getHAdjustment()
public Scrollbar getHScrollbar()
public int getScrollbarSpacing()
This is the scrollbar-spacing style property.
public ShadowType getShadowType()
public Adjustment getVAdjustment()
public Scrollbar getVScrollbar()
public void setPolicy(PolicyType hscrollbarPolicy, PolicyType vscrollbarPolicy)
public void setShadowType(ShadowType type)
NONE.