Slide and Slider Classes
- class gallerynpy.SlideLike(name: str, parent: Slider)
The base class for the slides and sliders.
- Parameters:
name – The name (identifier) of the SlideLike
parent – The
Slider
parent of the SlideLike
- get(identifier) Any | None
- put(item) bool
- property name: str
- Getter:
Gets the current name.
- Setter:
Sets the name (str value).
- Parameters:
name – The new name.
- property size: int
- Getter:
Gets the current size.
- class gallerynpy.Slide(name: str, parent: Slider = None, is_for_animations: bool = False)
Bases:
SlideLike
A slide to contain the
Item
s- Parameters:
name – The name of the slide.
parent – The
Slider
parent of this one.is_for_animations – Sets True if the slide will be marked as one for animations. If it is marked for animations, only items of that type (or maybe not) will be accepted.
- clone(name: str = None, include_parent: bool = False) Slide
Clones the slide.
- Parameters:
name – The new name of the slide. By default, is the own.
include_parent – If True, sets the parent slide as the parent of the cloned slide.
- Returns:
The cloned slide.
- get(identifier: int) Item | None
Gets the
Item
with the given identifier.- Parameters:
identifier – The item index
- Returns:
The item in the given index, or None if invalid.
- put(item: Item)
Adds a valid
Item
to the slide.- Parameters:
item – The item to be added.
- Returns:
True if the item was added, False otherwise.
- property is_for_animations: bool
- Getter:
Gets whether the slide is marked as one for animations.
- property name: str
- Getter:
Gets the current name.
- Setter:
Sets the name (str value).
- Parameters:
name – The new name.
- property size: int
- Getter:
Gets the current size.
Warning
In version 2.0 the clone()
method is broken and does not work as it should.
This will be fixed in later versions.
- class gallerynpy.Slider(name: str, parent: Slider = None)
Bases:
SlideLike
A slider to contain
Slide
s or otherSlider
s- Parameters:
name – The name of the slider.
parent – The
Slider
parent of this one.
- clone(name: str = None, include_parent: bool = False) Slider
Clone the slider and every slide or slider it has.
- Parameters:
name – The new name of the slider. By default, is the own.
include_parent – If True, sets the parent
Slider
as the parent of the cloned slide.
- Returns:
The cloned slider.
- create_slide(name: str, is_for_animations: bool = False) Slide
Creates a new
Slide
with this slider as parent.- Parameters:
name – The slide name
is_for_animations – Sets True if the slide will be marked as one for animations.
- Returns:
The created slide
- create_slider(name: str) Slider
Creates a new slide with this slider as parent.
- Parameters:
name – The slider name.
- Returns:
The created slider
- get(identifier: str) SlideLike | None
Gets the
Slide
orSlider
with the given identifier.- Parameters:
identifier – The item name
- Returns:
The item with the given name, or None if it is not present.
- put(item: SlideLike)
Adds the
Slide
orSlider
to this one.The name of the given item must be unique in this slider.
- Parameters:
item – The item to be added.
- Returns:
True if the item was added, False otherwise
- property name: str
- Getter:
Gets the current name.
- Setter:
Sets the name (str value).
- Parameters:
name – The new name.
- property size: int
- Getter:
Gets the current size.
- property slides: list[str]
- Getter:
Gets all the names of the slider items.