batgrl.gadgets.behaviors.movable_children#
Movable children behavior for a gadget.
Translate movable’s children by dragging them.
Classes
|
Movable children behavior for a gadget. |
- class batgrl.gadgets.behaviors.movable_children.MovableChildren(*, disable_child_oob=False, disable_child_ptf=False, is_grabbable: bool = True, ptf_on_grab: bool = False, mouse_button: Literal['left', 'middle', 'no_button', 'right'] = 'left', **kwargs)#
Bases:
Grabbable
Movable children behavior for a gadget.
Translate a gadget’s child by clicking and dragging it.
- Parameters:
- disable_child_oobbool, default: False
Disallow child gadgets from being translated out-of-bounds if true.
- disable_child_ptfbool, default: False
Whether child gadgets are pulled-to-front when clicked.
- is_grabbablebool, default: True
Whether grabbable behavior is enabled.
- ptf_on_grabbool, default: False
Whether the gadget will be pulled to front when grabbed.
- mouse_buttonMouseButton, default: “left”
Mouse button used for grabbing.
- Attributes:
- disable_child_oobbool
Disallow child gadgets from being translated out-of-bounds if true.
- disable_child_ptfbool
Whether child gadgets are pulled-to-front when clicked.
- is_grabbablebool
Whether grabbable behavior is enabled.
- ptf_on_grabbool
Whether the gadget will be pulled to front when grabbed.
- mouse_buttonMouseButton
Mouse button used for grabbing.
is_grabbed
boolWhether gadget is grabbed.
Methods
grab(mouse_event)
Grab the gadget.
ungrab(mouse_event)
Ungrab the gadget.
grab_update(mouse_event)
Update gadget with incoming mouse events while grabbed.
- grab(mouse_event)#
Grab the gadget.
- grab_update(mouse_event)#
Update gadget with incoming mouse events while grabbed.
- property is_grabbed: bool#
Whether gadget is grabbed.
- on_mouse(mouse_event)#
Determine if mouse event grabs or ungrabs gadget.
- ungrab(mouse_event)#
Ungrab the gadget.