Kinetic List: Custom list with kinetic interaction

Kinetic List: Custom list with kinetic interaction

class pymt.ui.widgets.composed.kineticlist.MTKineticList(**kwargs)

Bases: pymt.ui.widgets.stencilcontainer.MTStencilContainer

This is a kinetic container widget, that allows you to make a kinetic list scrolling in either direction.

Parameters :
align : string, default to ‘center’

Alignement of widget inside the row (or col). Can be one of ‘center’, ‘left’, ‘right’

friction : float, defaults to 10

The Pseudo-friction of the pseudo-kinetic scrolling. Formula for friction is

acceleration = 1 + friction * frame_delta_time
padding_x : int, defaults to 4

The spacing between scrolling items on the x axis

padding_y : int, defaults to 4

The spacing between scrolling items on the y axis

w_limit : int, defaults to 1

The limit of items that will appear horizontally. When this is set to a non-zero value the width(in terms of items in the kinetic list) will be w_limit, and the height will continually expand.

h_limit : int, defaults to 0

Exect opposite of w_limit. If I didn’t make either this or w_limit clear go bug xelapond

do_x : bool, defaults to False

Enable scrolling on the X axis

do_y : bool, defaults to True

Enable scrolling on the Y axis

title : string, defaults to <Title Goes Here>

Sets the title of the widget, which appears in 20 point font at the top

deletable : bool, defaults to True

When enabled it allows you to delete children by entering delete mode(red button in upper left)

searchable : bool, defaults to True

When enabled it allows you to enter search mode and filter items

trigger_distance : int, default to 3

Maximum trigger distance to dispatch event on children (this mean if you move too much, trigger will not happen.)

Styles :
bg-color : color

Background color of the widget

scrollbar-size : int

Size of scrollbar in pixel (use 0 to disable it.)

scrollbar-color : color

Color of scrollbar

scrollbar-margin : int int int int

Margin top/right/bottom/left of scrollbar (left are not used.)

Events :
on_delete (child)

Fired when an item gets deleted.

apply_filter(text)

Applies the filter to the current children set

do_layout()

Apply layout to all the items

endsearch()

Resets the children set to the full set

filter(pattern, attr)

Given an attribute of the children, and a pattern, return a list of the children with which pattern is in attr

process_kinetic()

Apply kinetic movement to all the items

search(pattern, attr)

Apply a search pattern to the current set of children

toggle_delete(touch)

Toggles the delete buttons on items Attached to the on_press handler of the delete button(self.db)

Toggles the search area Attached to the on_press handler of self.sb(the green search button)

class pymt.ui.widgets.composed.kineticlist.MTKineticItem(**kwargs)

Bases: pymt.ui.widgets.button.MTButton, pymt.ui.widgets.composed.kineticlist.MTKineticObject

The MTKineticItem is a MTKineticObject ready to be included in a MTKineticList. MTKineticItem have the behavior of the MTButton.

By default, on_press event is not fired only if the button is deletable and visible.

class pymt.ui.widgets.composed.kineticlist.MTKineticImage(**kwargs)

Bases: pymt.ui.widgets.button.MTImageButton, pymt.ui.widgets.composed.kineticlist.MTKineticObject

The MTKineticImage is a MTKineticObject ready to be included in a MTKineticList. MTKineticImage have the behavior of the MTImageButton.

By default, on_press event is not fired only if the button is deletable and visible.

Previous topic

Inner window: a lightweight window with fullscreen and resize ability

Next topic

ModalPopup: a simple popup that use modal window

This Page