ccu.fancyplots._gui.formatting

GUI elements for defining plot formatting parameters.

This module defines the FormattingSection class.

class ccu.fancyplots._gui.formatting.FormattingSection(parent: FancyPlotsGUI, *args, parameters: FormattingParameters | None = None, **kwargs)[source]

Bases: Labelframe, UpdatableFrame

A ttk.LabelFrame containing all formatting parameters.

Note that instances of this class are listeners for the custom <Validate> event emitted by frames.FancyFormatFrame instances.

Variables:
  • parent – The root.FancyPlotsGUI.

  • formatting_parameters – A data.FormattingParameters instance mapping the names of formatting parameters to their values. Defaults to a copy of data.DEFAULT_PARAMETERS.

  • frames – A list of FancyFormatFrame instances in which the formatting parameters are set.

Create a section for specifying plot formatting parameters.

Parameters:
  • parent – The running root.FancyPlotsGUI instance.

  • *args – Positional arguments for tkinter.Toplevel.

  • parameters – A formatting.FormattingParameters dictionary mapping parameter names to their values. Defauls to DEFAULT_PARAMETERS.

  • **kwargs – Keyword arguments fo tkinter.Toplevel.

_abc_impl = <_abc._abc_data object>
_is_protocol = False
_organize() None[source]
initialize_frames() list[FancyFormatFrame][source]

Create ttk.LabelFrame widgets for setting formatting parameters.

Returns:

A list of FancyFormatFrame widgets used to set formatting parameters.

Raises:
  • NotImplementedError – Unsupported annotation type for formatting

  • parameter. Only annotated type hints are supported.

reset_defaults() None[source]

Reset the parameter values to their defaults.

update_frames() None[source]

Update the values in the frame with the formatting parameters.

update_parameters(_: Event) None[source]

Update FormattingSection.formatting_parameters.