java-gnome version 4.0.19

org.gnome.gtk
Class ScrolledWindow

Object
  extended by org.freedesktop.bindings.Pointer
      extended by org.freedesktop.bindings.Proxy
          extended by org.gnome.glib.Object
              extended by org.gnome.gtk.Object
                  extended by org.gnome.gtk.Widget
                      extended by org.gnome.gtk.Container
                          extended by org.gnome.gtk.Bin
                              extended by org.gnome.gtk.ScrolledWindow

public class ScrolledWindow
extends Bin

Add scrollbars to a Widget. There are times when you have a Widget which is larger than the area you wish to constrain it to, and the usual way to deal with this is to enhance the Widget with scrollbars. ScrolledWindow is a Bin which enables you to control the scrollbars added in such cases.

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.

Since:
4.0.3
Author:
Sebastian Mancke, Andrew Cowie

Nested Class Summary
 
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
ScrolledWindow()
          Construct a ScrolledWindow.
 
Method Summary
 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.
 
Methods inherited from class org.gnome.gtk.Bin
getChild
 
Methods inherited from class org.gnome.gtk.Container
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

ScrolledWindow

public ScrolledWindow()
Construct a ScrolledWindow. This will automatically create default Adjustments for managing the horizontal and vertical ScrollBars.

Since:
4.0.3
Method Detail

add

public void add(Widget child)
Description copied from class: Container
Add a child Widget to this Container. This works for all the various Container types, of course, but most offer more specialized packing methods that allow you to control the positioning of the Widget being added with greater finesse.

Overrides:
add in class Container

addWithViewport

public void addWithViewport(Widget child)
Create a new Viewport and embeds the child Widget in it before adding it to the ScrolledWindow. This is a convenience function; you could always create the Viewport yourself if you really wanted. Note that this method is only for Widgets which do not support scrolling directly themselves; use 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().

Since:
4.0.15

getHAdjustment

public 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.

Since:
4.0.8

getHScrollbar

public Scrollbar getHScrollbar()
Get the Scrollbar Widget that is being used to draw the horizontal scroll bar on the bottom edge of this ScrolledWindow.

Since:
4.0.8

getScrollbarSpacing

public int getScrollbarSpacing()
Get the amount of spacing being drawn between the Viewport and the Scrollbars.

This is the scrollbar-spacing style property.

Since:
4.0.17

getShadowType

public ShadowType getShadowType()
Get the decoration currently set for this ScrolledWindow.

Since:
4.0.15

getVAdjustment

public 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.

Since:
4.0.8

getVScrollbar

public Scrollbar getVScrollbar()
Get the Scrollbar Widget that is being used to draw the vertical scroll bar on the right hand side of this ScrolledWindow.

Since:
4.0.8

setPolicy

public void setPolicy(PolicyType hscrollbarPolicy,
                      PolicyType vscrollbarPolicy)
Set the scrollbar policy for the horizontal and vertical scrollbars.

Since:
4.0.3

setShadowType

public void setShadowType(ShadowType type)
Set the type of decoration you want around the child Widget in the ScrolledWindow. You probably don't need this, since the default is NONE.

Since:
4.0.15


java-gnome