Skip to content

LiveButton

LiveButton widget

This image generated from example code below.

LiveButton #

Bases: QPushButton

A Widget to create a two-state (on-off) live mode QPushButton.

When pressed, a 'ContinuousSequenceAcquisition' is started or stopped and a pymmcore-plus signal continuousSequenceAcquisitionStarted or sequenceAcquisitionStopped is emitted.

Parameters:

Name Type Description Default
parent QWidget | None

Optional parent widget.

None
mmcore CMMCorePlus | None

Optional pymmcore_plus.CMMCorePlus micromanager core. By default, None. If not specified, the widget will use the active (or create a new) CMMCorePlus.instance.

None

Examples:

Combining LiveButton with other widgets

see ImagePreview

button_text_off: str property writable #

Set the live button text for when live mode is off.

Default = "Stop."

button_text_on: str property writable #

Set the live button text for when live mode is on.

Default = "Live."

icon_color_off: COLOR_TYPE property writable #

Set the live button color for when live mode is off.

Default = "magenta".

icon_color_on: COLOR_TYPE property writable #

Set the live button color for when live mode is on.

Default = (0. 255, 0).

Example#

live_button.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
"""Example usage of the LiveButton class.

Check also the 'image_widget.py' example to see the LiveButton
used in combination of other widgets.
"""

from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import LiveButton

app = QApplication([])

mmc = CMMCorePlus().instance()
mmc.loadSystemConfiguration()

live_btn = LiveButton()
live_btn.show()

app.exec_()