ccu.fancyplots._gui.frames

Validation-enabled GUI elements.

This module defines the FancyFormatFrame class.

class ccu.fancyplots._gui.frames.FancyFormatFrame(parent: ~tkinter.ttk.Labelframe, *args, label: str = '', value: ~typing.Any = None, tooltip: str = '', validator: ~ccu.fancyplots.validation.Validator[~ccu.fancyplots._gui.frames._T] = <function no_validation_validator>, serializer: ~ccu.fancyplots.validation.Serializer[~ccu.fancyplots._gui.frames._T] = <function default_serializer>, pad: tuple[float, float, float, float] = (5, 3, 5, 3), **kwargs)[source]

Bases: Labelframe

A ttk.LabelFrame for setting formatting parameters.

Note that FancyFormatFrame instances emit the <<Validate>> event. To listen for this event, handlers should be bound to the event using Misc.bind and Misc.event_add.

Variables:
  • entry – A ttk.Entry in which a user specifies a formatting parameter.

  • tooltip – A :class`ccu.fancyplots._gui.tooltip.Tooltip` displaying help text.

  • validator – A validation.Validator used to validate and convert the text in entry.

  • serializer – A validation.Serializer used to convert the Python value to a string.

A ttk.LabelFrame for setting formatting parameters.

Parameters:
  • parent – The containing ttk.LabelFrame.

  • *args – Positional parameters for ttk.LabelFrame.

  • label – The name of the formatting parameter. Defaults to “”.

  • value – The initial value of the formatting parameter. Defaults to None.

  • tooltip – The tooltip message. Defaults to “”.

  • validator – A Validator for validating and converting user input. Defaults to validation.no_validation_validator().

  • serializer – A validation.Serializer instance for

  • converting the Python version of the value to a string.

  • pad – Specify the padding (left, top, bottom, right) to use for the tooltip. Defaults to (5, 3, 5, 3).

  • **kwargs – Keyword arguments for ttk.LabelFrame.

alerting_validator(value: str) bool[source]

Validate a value and generate a <<Validate>> event.

Parameters:

value – The value to validate.

Returns:

True if the value if valid. False, otherwise.

Note

Listeners should be bound to the <<Validate>> event in order to respond to this behaviour.

property label_text: str

The text used for the FancyFormatFrame label.

property python_value: _T

The Python value of the text in FancyFormatFrame.entry.

Raises:
property value

The text in FancyFormatFrame.entry.

class ccu.fancyplots._gui.frames.UpdatableFrame(*args, **kwargs)[source]

Bases: Protocol

A GUI element whose children’s state depend on their data.

_abc_impl = <_abc._abc_data object>
_is_protocol = True
update_frames() None[source]

This function should update all children of the frame.