Trait gtk::prelude::ScrolledWindowExt[][src]

pub trait ScrolledWindowExt: 'static {
Show methods fn is_capture_button_press(&self) -> bool;
fn hadjustment(&self) -> Adjustment;
fn hscrollbar(&self) -> Option<Widget>;
fn is_kinetic_scrolling(&self) -> bool;
fn max_content_height(&self) -> i32;
fn max_content_width(&self) -> i32;
fn min_content_height(&self) -> i32;
fn min_content_width(&self) -> i32;
fn is_overlay_scrolling(&self) -> bool;
fn placement(&self) -> CornerType;
fn policy(&self) -> (PolicyType, PolicyType);
fn propagates_natural_height(&self) -> bool;
fn propagates_natural_width(&self) -> bool;
fn shadow_type(&self) -> ShadowType;
fn vadjustment(&self) -> Adjustment;
fn vscrollbar(&self) -> Option<Widget>;
fn set_capture_button_press(&self, capture_button_press: bool);
fn set_hadjustment<P: IsA<Adjustment>>(&self, hadjustment: Option<&P>);
fn set_kinetic_scrolling(&self, kinetic_scrolling: bool);
fn set_max_content_height(&self, height: i32);
fn set_max_content_width(&self, width: i32);
fn set_min_content_height(&self, height: i32);
fn set_min_content_width(&self, width: i32);
fn set_overlay_scrolling(&self, overlay_scrolling: bool);
fn set_placement(&self, window_placement: CornerType);
fn set_policy(
        &self,
        hscrollbar_policy: PolicyType,
        vscrollbar_policy: PolicyType
    );
fn set_propagate_natural_height(&self, propagate: bool);
fn set_propagate_natural_width(&self, propagate: bool);
fn set_shadow_type(&self, type_: ShadowType);
fn set_vadjustment<P: IsA<Adjustment>>(&self, vadjustment: Option<&P>);
fn unset_placement(&self);
fn hscrollbar_policy(&self) -> PolicyType;
fn set_hscrollbar_policy(&self, hscrollbar_policy: PolicyType);
fn vscrollbar_policy(&self) -> PolicyType;
fn set_vscrollbar_policy(&self, vscrollbar_policy: PolicyType);
fn window_placement(&self) -> CornerType;
fn set_window_placement(&self, window_placement: CornerType);
fn connect_edge_overshot<F: Fn(&Self, PositionType) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_edge_reached<F: Fn(&Self, PositionType) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_move_focus_out(&self, direction_type: DirectionType);
fn connect_scroll_child<F: Fn(&Self, ScrollType, bool) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_scroll_child(&self, scroll: ScrollType, horizontal: bool) -> bool;
fn connect_hadjustment_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_hscrollbar_policy_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_kinetic_scrolling_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_max_content_height_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_max_content_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_min_content_height_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_min_content_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_overlay_scrolling_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_propagate_natural_height_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_propagate_natural_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_shadow_type_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_vadjustment_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_vscrollbar_policy_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_window_placement_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Required methods

Return whether button presses are captured during kinetic scrolling. See set_capture_button_press().

Returns

true if button presses are captured during kinetic scrolling

Returns the horizontal scrollbar’s adjustment, used to connect the horizontal scrollbar to the child widget’s horizontal scroll functionality.

Returns

the horizontal Adjustment

Returns the horizontal scrollbar of self.

Returns

the horizontal scrollbar of the scrolled window.

Returns the specified kinetic scrolling behavior.

Returns

the scrolling behavior flags.

This is supported on crate feature v3_22 only.

Returns the maximum content height set.

Returns

the maximum content height, or -1

This is supported on crate feature v3_22 only.

Returns the maximum content width set.

Returns

the maximum content width, or -1

Gets the minimal content height of self, or -1 if not set.

Returns

the minimal content height

Gets the minimum content width of self, or -1 if not set.

Returns

the minimum content width

Returns whether overlay scrolling is enabled for this scrolled window.

Returns

true if overlay scrolling is enabled

Gets the placement of the contents with respect to the scrollbars for the scrolled window. See set_placement().

Returns

the current placement value.

See also set_placement() and unset_placement().

Retrieves the current policy values for the horizontal and vertical scrollbars. See set_policy().

Returns

hscrollbar_policy

location to store the policy for the horizontal scrollbar, or None

vscrollbar_policy

location to store the policy for the vertical scrollbar, or None

This is supported on crate feature v3_22 only.

Reports whether the natural height of the child will be calculated and propagated through the scrolled window’s requested natural height.

Returns

whether natural height propagation is enabled.

This is supported on crate feature v3_22 only.

Reports whether the natural width of the child will be calculated and propagated through the scrolled window’s requested natural width.

Returns

whether natural width propagation is enabled.

Gets the shadow type of the scrolled window. See set_shadow_type().

Returns

the current shadow type

Returns the vertical scrollbar’s adjustment, used to connect the vertical scrollbar to the child widget’s vertical scroll functionality.

Returns

the vertical Adjustment

Returns the vertical scrollbar of self.

Returns

the vertical scrollbar of the scrolled window.

Changes the behaviour of self 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 signal::Widget::button-press-event. If they don’t, and handle additionally handle signal::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.

capture_button_press

true to capture button presses

Sets the Adjustment for the horizontal scrollbar.

hadjustment

the Adjustment to use, or None to create a new one

Turns kinetic scrolling on or off. Kinetic scrolling only applies to devices with source GDK_SOURCE_TOUCHSCREEN.

kinetic_scrolling

true to enable kinetic scrolling

This is supported on crate feature v3_22 only.

Sets the maximum height that self should keep visible. The self will grow up to this height before it starts scrolling the content.

It is a programming error to set the maximum content height to a value smaller than property::ScrolledWindow::min-content-height.

height

the maximum content height

This is supported on crate feature v3_22 only.

Sets the maximum width that self should keep visible. The self will grow up to this width before it starts scrolling the content.

It is a programming error to set the maximum content width to a value smaller than property::ScrolledWindow::min-content-width.

width

the maximum content width

Sets the minimum height that self should keep visible. Note that this can and (usually will) be smaller than the minimum size of the content.

It is a programming error to set the minimum content height to a value greater than property::ScrolledWindow::max-content-height.

height

the minimal content height

Sets the minimum width that self should keep visible. Note that this can and (usually will) be smaller than the minimum size of the content.

It is a programming error to set the minimum content width to a value greater than property::ScrolledWindow::max-content-width.

width

the minimal content width

Enables or disables overlay scrolling for this scrolled window.

overlay_scrolling

whether to enable overlay scrolling

Sets the placement of the contents with respect to the scrollbars for the scrolled window.

The default is CornerType::TopLeft, meaning the child is in the top left, with the scrollbars underneath and to the right. Other values in CornerType are CornerType::TopRight, CornerType::BottomLeft, and CornerType::BottomRight.

See also placement() and unset_placement().

window_placement

position of the child window

Sets the scrollbar policy for the horizontal and vertical scrollbars.

The policy determines when the scrollbar should appear; it is a value from the PolicyType enumeration. If PolicyType::Always, the scrollbar is always present; if PolicyType::Never, the scrollbar is never present; if PolicyType::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).

hscrollbar_policy

policy for horizontal bar

vscrollbar_policy

policy for vertical bar

This is supported on crate feature v3_22 only.

Sets whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.

propagate

whether to propagate natural height

This is supported on crate feature v3_22 only.

Sets whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.

propagate

whether to propagate natural width

Changes the type of shadow drawn around the contents of self.

type_

kind of shadow to draw around scrolled window contents

Sets the Adjustment for the vertical scrollbar.

vadjustment

the Adjustment to use, or None to create a new one

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 CornerType::TopLeft.

See also set_placement() and placement().

The ::edge-overshot signal is emitted whenever user initiated scrolling makes the scrolled window firmly surpass (i.e. with some edge resistance) the lower or upper limits defined by the adjustment in that orientation.

A similar behavior without edge resistance is provided by the signal::ScrolledWindow::edge-reached signal.

Note: The pos argument is LTR/RTL aware, so callers should be aware too if intending to provide behavior on horizontal edges.

pos

edge side that was hit

The ::edge-reached signal is emitted whenever user-initiated scrolling makes the scrolled window exactly reach the lower or upper limits defined by the adjustment in that orientation.

A similar behavior with edge resistance is provided by the signal::ScrolledWindow::edge-overshot signal.

Note: The pos argument is LTR/RTL aware, so callers should be aware too if intending to provide behavior on horizontal edges.

pos

edge side that was reached

The ::move-focus-out signal is a [keybinding signal][GtkBindingSignal] which gets emitted when focus is moved away from the scrolled window by a keybinding. The signal::Widget::move-focus signal is emitted with direction_type on this scrolled window’s toplevel parent in the container hierarchy. The default bindings for this signal are Ctrl + Tab to move forward and Ctrl + Shift + Tab to move backward.

direction_type

either DirectionType::TabForward or DirectionType::TabBackward

The ::scroll-child signal is a [keybinding signal][GtkBindingSignal] which gets emitted when a keybinding that scrolls is pressed. The horizontal or vertical adjustment is updated which triggers a signal that the scrolled window’s child may listen to and scroll itself.

scroll

a ScrollType describing how much to scroll

horizontal

whether the keybinding scrolls the child horizontally or not

This is supported on crate feature v3_22 only.
This is supported on crate feature v3_22 only.
This is supported on crate feature v3_22 only.
This is supported on crate feature v3_22 only.

Implementors