Class: Gtk::ScrolledWindow
- Inherits:
-
Object
- Object
- Gtk::ScrolledWindow
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#add_with_viewport(child) ⇒ nil
Used to add children without native scrolling capabilities.
-
#capture_button_press ⇒ TrueClass
Return whether button presses are captured during kinetic scrolling.
-
#capture_button_press=(capture_button_press) ⇒ nil
Changes the behaviour of scrolled_window with regard to the initial event that possibly starts kinetic scrolling.
-
#get_policy(hscrollbar_policy, vscrollbar_policy) ⇒ nil
Retrieves the current policy values for the horizontal and vertical scrollbars.
-
#hadjustment ⇒ Gtk::Adjustment
Hadjustment.
- #hadjustment=(hadjustment) ⇒ Gtk::Adjustment
-
#hscrollbar ⇒ Gtk::Widget
Returns the horizontal scrollbar of scrolled_window.
-
#hscrollbar_policy ⇒ Gtk::PolicyType
Hscrollbar-policy.
- #hscrollbar_policy=(hscrollbar_policy) ⇒ Gtk::PolicyType
-
#kinetic_scrolling ⇒ TrueClass
Returns the specified kinetic scrolling behavior.
-
#kinetic_scrolling=(kinetic_scrolling) ⇒ TrueClass
Whether kinetic scrolling is enabled or not.
-
#kinetic_scrolling? ⇒ TrueClass
Whether kinetic scrolling is enabled or not.
-
#max_content_height ⇒ Integer
The maximum content height of scrolled_window, or -1 if not set.
-
#max_content_height=(max_content_height) ⇒ Integer
The maximum content height of scrolled_window, or -1 if not set.
-
#max_content_width ⇒ Integer
The maximum content width of scrolled_window, or -1 if not set.
-
#max_content_width=(max_content_width) ⇒ Integer
The maximum content width of scrolled_window, or -1 if not set.
-
#min_content_height ⇒ Integer
The minimum content height of scrolled_window, or -1 if not set.
-
#min_content_height=(min_content_height) ⇒ Integer
The minimum content height of scrolled_window, or -1 if not set.
-
#min_content_width ⇒ Integer
The minimum content width of scrolled_window, or -1 if not set.
-
#min_content_width=(min_content_width) ⇒ Integer
The minimum content width of scrolled_window, or -1 if not set.
-
#new(hadjustment, vadjustment) ⇒ Gtk::Widget
Creates a new scrolled window.
-
#overlay_scrolling ⇒ TrueClass
Returns whether overlay scrolling is enabled for this scrolled window.
-
#overlay_scrolling=(overlay_scrolling) ⇒ TrueClass
Whether overlay scrolling is enabled or not.
-
#overlay_scrolling? ⇒ TrueClass
Whether overlay scrolling is enabled or not.
-
#placement ⇒ Gtk::CornerType
Gets the placement of the contents with respect to the scrollbars for the scrolled window.
-
#placement=(window_placement) ⇒ nil
Sets the placement of the contents with respect to the scrollbars for the scrolled window.
-
#propagate_natural_height ⇒ TrueClass
Reports whether the natural height of the child will be calculated and propagated through the scrolled window’s requested natural height.
-
#propagate_natural_height=(propagate_natural_height) ⇒ TrueClass
Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.
-
#propagate_natural_height? ⇒ TrueClass
Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.
-
#propagate_natural_width ⇒ TrueClass
Reports whether the natural width of the child will be calculated and propagated through the scrolled window’s requested natural width.
-
#propagate_natural_width=(propagate_natural_width) ⇒ TrueClass
Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.
-
#propagate_natural_width? ⇒ TrueClass
Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.
-
#set_policy(hscrollbar_policy, vscrollbar_policy) ⇒ nil
Sets the scrollbar policy for the horizontal and vertical scrollbars.
-
#shadow_type ⇒ Gtk::ShadowType
Shadow-type.
- #shadow_type=(shadow_type) ⇒ Gtk::ShadowType
-
#unset_placement ⇒ nil
Unsets the placement of the contents with respect to the scrollbars for the scrolled window.
-
#vadjustment ⇒ Gtk::Adjustment
Vadjustment.
- #vadjustment=(vadjustment) ⇒ Gtk::Adjustment
-
#vscrollbar ⇒ Gtk::Widget
Returns the vertical scrollbar of scrolled_window.
-
#vscrollbar_policy ⇒ Gtk::PolicyType
Vscrollbar-policy.
- #vscrollbar_policy=(vscrollbar_policy) ⇒ Gtk::PolicyType
-
#window_placement ⇒ Gtk::CornerType
Window-placement.
- #window_placement=(window_placement) ⇒ Gtk::CornerType
-
#window_placement_set=(window_placement_set) ⇒ TrueClass
Whether “window-placement” should be used to determine the location of the contents with respect to the scrollbars.
-
#window_placement_set? ⇒ TrueClass
Whether “window-placement” should be used to determine the location of the contents with respect to the scrollbars.
Instance Method Details
#add_with_viewport(child) ⇒ nil
Used to add children without native scrolling capabilities. This is simply a convenience function; it is equivalent to adding the unscrollable child to a viewport, then adding the viewport to the scrolled window. If a child has native scrolling, use gtk_container_add() instead of this function.
The viewport scrolls the child by moving its Gdk::Window, and takes the size of the child to be the size of its toplevel Gdk::Window. This will be very wrong for most widgets that support native scrolling; for example, if you add a widget such as Gtk::TreeView with a viewport, the whole widget will scroll, including the column headings. Thus, widgets with native scrolling support should not be used with the Gtk::Viewport proxy.
A widget supports scrolling natively if it implements the Gtk::Scrollable interface.
#capture_button_press ⇒ TrueClass
Return whether button presses are captured during kinetic scrolling. See gtk_scrolled_window_set_capture_button_press().
#capture_button_press=(capture_button_press) ⇒ nil
Changes the behaviour of scrolled_window with regard to the initial event that possibly starts kinetic scrolling. When capture_button_press is set to true, the event is captured by the scrolled window, and then later replayed if it is meant to go to the child widget.
This should be enabled if any child widgets perform non-reversible actions on Gtk::Widget::button-press-event. If they don’t, and handle additionally handle Gtk::Widget::grab-broken-event, it might be better to set capture_button_press to false.
This setting only has an effect if kinetic scrolling is enabled.
#get_policy(hscrollbar_policy, vscrollbar_policy) ⇒ nil
Retrieves the current policy values for the horizontal and vertical scrollbars. See gtk_scrolled_window_set_policy().
#hadjustment ⇒ Gtk::Adjustment
Returns hadjustment.
#hadjustment=(hadjustment) ⇒ Gtk::Adjustment
#hscrollbar ⇒ Gtk::Widget
Returns the horizontal scrollbar of scrolled_window.
#hscrollbar_policy ⇒ Gtk::PolicyType
Returns hscrollbar-policy.
#hscrollbar_policy=(hscrollbar_policy) ⇒ Gtk::PolicyType
#kinetic_scrolling ⇒ TrueClass
Returns the specified kinetic scrolling behavior.
#kinetic_scrolling=(kinetic_scrolling) ⇒ TrueClass
Whether kinetic scrolling is enabled or not. Kinetic scrolling only applies to devices with source %GDK_SOURCE_TOUCHSCREEN.
#kinetic_scrolling? ⇒ TrueClass
Whether kinetic scrolling is enabled or not. Kinetic scrolling only applies to devices with source %GDK_SOURCE_TOUCHSCREEN.
#max_content_height ⇒ Integer
The maximum content height of scrolled_window, or -1 if not set.
#max_content_height=(max_content_height) ⇒ Integer
The maximum content height of scrolled_window, or -1 if not set.
#max_content_width ⇒ Integer
The maximum content width of scrolled_window, or -1 if not set.
#max_content_width=(max_content_width) ⇒ Integer
The maximum content width of scrolled_window, or -1 if not set.
#min_content_height ⇒ Integer
The minimum content height of scrolled_window, or -1 if not set.
#min_content_height=(min_content_height) ⇒ Integer
The minimum content height of scrolled_window, or -1 if not set.
#min_content_width ⇒ Integer
The minimum content width of scrolled_window, or -1 if not set.
#min_content_width=(min_content_width) ⇒ Integer
The minimum content width of scrolled_window, or -1 if not set.
#new(hadjustment, vadjustment) ⇒ Gtk::Widget
Creates a new scrolled window.
The two arguments are the scrolled window’s adjustments; these will be shared with the scrollbars and the child widget to keep the bars in sync with the child. Usually you want to pass nil for the adjustments, which will cause the scrolled window to create them for you.
#overlay_scrolling ⇒ TrueClass
Returns whether overlay scrolling is enabled for this scrolled window.
#overlay_scrolling=(overlay_scrolling) ⇒ TrueClass
Whether overlay scrolling is enabled or not. If it is, the scrollbars are only added as traditional widgets when a mouse is present. Otherwise, they are overlayed on top of the content, as narrow indicators.
Note that overlay scrolling can also be globally disabled, with the Gtk::Settings::gtk-overlay-scrolling setting.
#overlay_scrolling? ⇒ TrueClass
Whether overlay scrolling is enabled or not. If it is, the scrollbars are only added as traditional widgets when a mouse is present. Otherwise, they are overlayed on top of the content, as narrow indicators.
Note that overlay scrolling can also be globally disabled, with the Gtk::Settings::gtk-overlay-scrolling setting.
#placement ⇒ Gtk::CornerType
Gets the placement of the contents with respect to the scrollbars for the scrolled window. See gtk_scrolled_window_set_placement(). See also gtk_scrolled_window_set_placement() and gtk_scrolled_window_unset_placement().
#placement=(window_placement) ⇒ nil
Sets the placement of the contents with respect to the scrollbars for the scrolled window.
The default is %GTK_CORNER_TOP_LEFT, meaning the child is in the top left, with the scrollbars underneath and to the right. Other values in Gtk::CornerType are %GTK_CORNER_TOP_RIGHT, %GTK_CORNER_BOTTOM_LEFT, and %GTK_CORNER_BOTTOM_RIGHT.
See also gtk_scrolled_window_get_placement() and gtk_scrolled_window_unset_placement().
#propagate_natural_height ⇒ TrueClass
Reports whether the natural height of the child will be calculated and propagated through the scrolled window’s requested natural height.
#propagate_natural_height=(propagate_natural_height) ⇒ TrueClass
Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.
This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.
#propagate_natural_height? ⇒ TrueClass
Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.
This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.
#propagate_natural_width ⇒ TrueClass
Reports whether the natural width of the child will be calculated and propagated through the scrolled window’s requested natural width.
#propagate_natural_width=(propagate_natural_width) ⇒ TrueClass
Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.
This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.
#propagate_natural_width? ⇒ TrueClass
Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.
This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.
#set_policy(hscrollbar_policy, vscrollbar_policy) ⇒ nil
Sets the scrollbar policy for the horizontal and vertical scrollbars.
The policy determines when the scrollbar should appear; it is a value from the Gtk::PolicyType enumeration. If %GTK_POLICY_ALWAYS, the scrollbar is always present; if %GTK_POLICY_NEVER, the scrollbar is never present; if %GTK_POLICY_AUTOMATIC, the scrollbar is present only if needed (that is, if the slider part of the bar would be smaller than the trough — the display is larger than the page size).
#shadow_type ⇒ Gtk::ShadowType
Returns shadow-type.
#shadow_type=(shadow_type) ⇒ Gtk::ShadowType
#unset_placement ⇒ nil
Unsets the placement of the contents with respect to the scrollbars for the scrolled window. If no window placement is set for a scrolled window, it defaults to %GTK_CORNER_TOP_LEFT.
See also gtk_scrolled_window_set_placement() and gtk_scrolled_window_get_placement().
#vadjustment ⇒ Gtk::Adjustment
Returns vadjustment.
#vadjustment=(vadjustment) ⇒ Gtk::Adjustment
#vscrollbar ⇒ Gtk::Widget
Returns the vertical scrollbar of scrolled_window.
#vscrollbar_policy ⇒ Gtk::PolicyType
Returns vscrollbar-policy.
#vscrollbar_policy=(vscrollbar_policy) ⇒ Gtk::PolicyType
#window_placement ⇒ Gtk::CornerType
Returns window-placement.
#window_placement=(window_placement) ⇒ Gtk::CornerType
#window_placement_set=(window_placement_set) ⇒ TrueClass
Whether “window-placement” should be used to determine the location of the contents with respect to the scrollbars.
#window_placement_set? ⇒ TrueClass
Whether “window-placement” should be used to determine the location of the contents with respect to the scrollbars.