Skip to main content

ScrolledWindowExt

Trait ScrolledWindowExt 

Source
pub trait ScrolledWindowExt: IsA<ScrolledWindow> + 'static {
Show 57 methods // Provided 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(&self, hadjustment: Option<&impl IsA<Adjustment>>) { ... } 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(&self, vadjustment: Option<&impl IsA<Adjustment>>) { ... } 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

Trait containing all ScrolledWindow methods.

§Implementors

PlacesSidebar, ScrolledWindow

Provided Methods§

Source

fn is_capture_button_press(&self) -> bool

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

§Returns

true if button presses are captured during kinetic scrolling

Source

fn hadjustment(&self) -> Adjustment

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

§Returns

the horizontal Adjustment

Source

fn hscrollbar(&self) -> Option<Widget>

Returns the horizontal scrollbar of self.

§Returns

the horizontal scrollbar of the scrolled window.

Source

fn is_kinetic_scrolling(&self) -> bool

Returns the specified kinetic scrolling behavior.

§Returns

the scrolling behavior flags.

Source

fn max_content_height(&self) -> i32

Returns the maximum content height set.

§Returns

the maximum content height, or -1

Source

fn max_content_width(&self) -> i32

Returns the maximum content width set.

§Returns

the maximum content width, or -1

Source

fn min_content_height(&self) -> i32

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

§Returns

the minimal content height

Source

fn min_content_width(&self) -> i32

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

§Returns

the minimum content width

Source

fn is_overlay_scrolling(&self) -> bool

Returns whether overlay scrolling is enabled for this scrolled window.

§Returns

true if overlay scrolling is enabled

Source

fn placement(&self) -> CornerType

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().

Source

fn policy(&self) -> (PolicyType, PolicyType)

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

Source

fn propagates_natural_height(&self) -> bool

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.

Source

fn propagates_natural_width(&self) -> bool

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.

Source

fn shadow_type(&self) -> ShadowType

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

§Returns

the current shadow type

Source

fn vadjustment(&self) -> Adjustment

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

§Returns

the vertical Adjustment

Source

fn vscrollbar(&self) -> Option<Widget>

Returns the vertical scrollbar of self.

§Returns

the vertical scrollbar of the scrolled window.

Source

fn set_capture_button_press(&self, capture_button_press: bool)

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 button-press-event. If they don’t, and handle additionally handle 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

Source

fn set_hadjustment(&self, hadjustment: Option<&impl IsA<Adjustment>>)

Sets the Adjustment for the horizontal scrollbar.

§hadjustment

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

Source

fn set_kinetic_scrolling(&self, kinetic_scrolling: bool)

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

§kinetic_scrolling

true to enable kinetic scrolling

Source

fn set_max_content_height(&self, height: i32)

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 min-content-height.

§height

the maximum content height

Source

fn set_max_content_width(&self, width: i32)

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 min-content-width.

§width

the maximum content width

Source

fn set_min_content_height(&self, height: i32)

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 max-content-height.

§height

the minimal content height

Source

fn set_min_content_width(&self, width: i32)

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 max-content-width.

§width

the minimal content width

Source

fn set_overlay_scrolling(&self, overlay_scrolling: bool)

Enables or disables overlay scrolling for this scrolled window.

§overlay_scrolling

whether to enable overlay scrolling

Source

fn set_placement(&self, window_placement: CornerType)

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

Source

fn set_policy( &self, hscrollbar_policy: PolicyType, vscrollbar_policy: PolicyType, )

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

Source

fn set_propagate_natural_height(&self, propagate: bool)

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

Source

fn set_propagate_natural_width(&self, propagate: bool)

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

Source

fn set_shadow_type(&self, type_: ShadowType)

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

§type_

kind of shadow to draw around scrolled window contents

Source

fn set_vadjustment(&self, vadjustment: Option<&impl IsA<Adjustment>>)

Sets the Adjustment for the vertical scrollbar.

§vadjustment

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

Source

fn unset_placement(&self)

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().

Source

fn hscrollbar_policy(&self) -> PolicyType

Source

fn set_hscrollbar_policy(&self, hscrollbar_policy: PolicyType)

Source

fn vscrollbar_policy(&self) -> PolicyType

Source

fn set_vscrollbar_policy(&self, vscrollbar_policy: PolicyType)

Source

fn window_placement(&self) -> CornerType

Source

fn set_window_placement(&self, window_placement: CornerType)

Source

fn connect_edge_overshot<F: Fn(&Self, PositionType) + 'static>( &self, f: F, ) -> SignalHandlerId

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

Source

fn connect_edge_reached<F: Fn(&Self, PositionType) + 'static>( &self, f: F, ) -> SignalHandlerId

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

Source

fn connect_move_focus_out<F: Fn(&Self, DirectionType) + 'static>( &self, f: F, ) -> SignalHandlerId

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

Source

fn emit_move_focus_out(&self, direction_type: DirectionType)

Source

fn connect_scroll_child<F: Fn(&Self, ScrollType, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

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

Source

fn emit_scroll_child(&self, scroll: ScrollType, horizontal: bool) -> bool

Source

fn connect_hadjustment_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_hscrollbar_policy_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_kinetic_scrolling_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_max_content_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_max_content_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_min_content_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_min_content_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_overlay_scrolling_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_propagate_natural_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_propagate_natural_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_shadow_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_vadjustment_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_vscrollbar_policy_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_window_placement_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§