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:
LabelframeA
ttk.LabelFramefor setting formatting parameters.Note that
FancyFormatFrameinstances emit the <<Validate>> event. To listen for this event, handlers should be bound to the event usingMisc.bindandMisc.event_add.- Variables:
entry – A
ttk.Entryin which a user specifies a formatting parameter.tooltip – A :class`ccu.fancyplots._gui.tooltip.Tooltip` displaying help text.
validator – A
validation.Validatorused to validate and convert the text inentry.serializer – A
validation.Serializerused to convert the Python value to a string.
A
ttk.LabelFramefor 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
Validatorfor validating and converting user input. Defaults tovalidation.no_validation_validator().serializer – A
validation.Serializerinstance forconverting 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 python_value: _T¶
The Python value of the text in
FancyFormatFrame.entry.- Raises:
ValidationError – The current value in
FancyFormatFrame.entry –
- property value¶
The text in
FancyFormatFrame.entry.