Class: Handy::Carousel

Inherits:
Gtk::EventBox
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGtk::Widget

Creates a new HdyCarousel.

Instance Method Details

#allow_long_swipesBoolean

Gets whether to allow swiping for more than one page at a time.

Returns:

  • (Boolean)

    TRUE if long swipes are allowed

#allow_long_swipes=(allow_long_swipes) ⇒ Boolean

Whether to allow swiping for more than one page at a time.

If the value is FALSE, each swipe can only move to the adjacent pages.

Parameters:

  • allow_long_swipes (Boolean)

Returns:

  • (Boolean)

    allow-long-swipes

  • (Boolean)

    allow-long-swipes

#allow_long_swipes?Boolean

Whether to allow swiping for more than one page at a time.

If the value is FALSE, each swipe can only move to the adjacent pages.

Returns:

  • (Boolean)

    allow-long-swipes

#allow_mouse_dragBoolean

Sets whether self can be dragged with mouse pointer.

Returns:

  • (Boolean)

    TRUE if self can be dragged with mouse

#allow_mouse_drag=(allow_mouse_drag) ⇒ Boolean

Sets whether the [classCarousel] can be dragged with mouse pointer.

If the value is FALSE, dragging is only available on touch.

Parameters:

  • allow_mouse_drag (Boolean)

Returns:

  • (Boolean)

    allow-mouse-drag

  • (Boolean)

    allow-mouse-drag

#allow_mouse_drag?Boolean

Sets whether the [classCarousel] can be dragged with mouse pointer.

If the value is FALSE, dragging is only available on touch.

Returns:

  • (Boolean)

    allow-mouse-drag

#allow_scroll_wheelBoolean

Gets whether self will respond to scroll wheel events.

Returns:

  • (Boolean)

    TRUE if self will respond to scroll wheel events

#allow_scroll_wheel=(allow_scroll_wheel) ⇒ Boolean

Whether the widget will respond to scroll wheel events.

If the value is FALSE, wheel events will be ignored.

Parameters:

  • allow_scroll_wheel (Boolean)

Returns:

  • (Boolean)

    allow-scroll-wheel

  • (Boolean)

    allow-scroll-wheel

#allow_scroll_wheel?Boolean

Whether the widget will respond to scroll wheel events.

If the value is FALSE, wheel events will be ignored.

Returns:

  • (Boolean)

    allow-scroll-wheel

#animation_durationInteger

Animation duration used by [methodCarousel.scroll_to], in milliseconds.

Returns:

  • (Integer)

    animation-duration

#animation_duration=(animation_duration) ⇒ Integer

Animation duration used by [methodCarousel.scroll_to], in milliseconds.

Parameters:

  • animation_duration (Integer)

Returns:

  • (Integer)

    animation-duration

  • (Integer)

    animation-duration

#insert(child, position) ⇒ nil

Inserts child into self at position position.

If position is -1, or larger than the number of pages, child will be appended to the end.

Parameters:

  • child (Gtk::Widget)

    a widget to add

  • position (Integer)

    the position to insert child in

Returns:

  • (nil)

#interactiveBoolean

Gets whether self can be navigated.

Returns:

  • (Boolean)

    TRUE if self can be swiped

#interactive=(interactive) ⇒ Boolean

Whether the carousel can be navigated.

This can be used to temporarily disable a HdyCarousel to only allow navigating it in a certain state.

Parameters:

  • interactive (Boolean)

Returns:

  • (Boolean)

    interactive

  • (Boolean)

    interactive

#interactive?Boolean

Whether the carousel can be navigated.

This can be used to temporarily disable a HdyCarousel to only allow navigating it in a certain state.

Returns:

  • (Boolean)

    interactive

#n_pagesInteger

The number of pages in a [classCarousel].

Returns:

  • (Integer)

    n-pages

#n_pages=(n_pages) ⇒ Integer

The number of pages in a [classCarousel].

Parameters:

  • n_pages (Integer)

Returns:

  • (Integer)

    n-pages

  • (Integer)

    n-pages

#positionFloat

Current scrolling position, unitless.

1 matches 1 page. Use [methodCarousel.scroll_to] for changing it.

Returns:

  • (Float)

    position

#position=(position) ⇒ Float

Current scrolling position, unitless.

1 matches 1 page. Use [methodCarousel.scroll_to] for changing it.

Parameters:

  • position (Float)

Returns:

  • (Float)

    position

  • (Float)

    position

#prepend(child) ⇒ nil

Prepends child to self.

Parameters:

  • child (Gtk::Widget)

    a widget to add

Returns:

  • (nil)

#reorder(child, position) ⇒ nil

Moves child into position position.

If position is -1, or larger than the number of pages, child will be moved to the end.

Parameters:

  • child (Gtk::Widget)

    a widget to add

  • position (Integer)

    the position to move child to

Returns:

  • (nil)

#reveal_durationInteger

Page reveal duration, in milliseconds.

Returns:

  • (Integer)

    reveal-duration

#reveal_duration=(reveal_duration) ⇒ Integer

Page reveal duration, in milliseconds.

Parameters:

  • reveal_duration (Integer)

Returns:

  • (Integer)

    reveal-duration

  • (Integer)

    reveal-duration

#scroll_to(widget) ⇒ nil

Scrolls to widget position with an animation.

[propertyCarousel:animation-duration] property can be used for controlling the duration.

Parameters:

  • widget (Gtk::Widget)

    a child of self

Returns:

  • (nil)

#scroll_to_full(widget, duration) ⇒ nil

Scrolls to widget position with an animation.

Parameters:

  • widget (Gtk::Widget)

    a child of self

  • duration (Integer)

    animation duration, in milliseconds

Returns:

  • (nil)

#spacingInteger

Spacing between pages in pixels.

Returns:

  • (Integer)

    spacing

#spacing=(spacing) ⇒ Integer

Spacing between pages in pixels.

Parameters:

  • spacing (Integer)

Returns:

  • (Integer)

    spacing

  • (Integer)

    spacing