pygvisuals.designs package

Package providing design templates for applications with widgets.

pygvisuals.designs.setDefaultDesign(design)[source]

Set the default-design to a copy of the given design. The fallback will be replaced by an internal fallback.

Parameters

design – A PyGVisuals-design to set as default.

pygvisuals.designs.getDefaultDesign()[source]

Return the default-design to be used for defaults for all widgets.

Returns

A PyGVisuals-design that is being used as default.

pygvisuals.designs.getFallbackDesign()[source]

Return the fallback-design to be used as fallback for all default-designs.

Widgets should define design-attributes with a default here by asigning a value to a new attribute. e.g.: getFallbackDesign().attribute = value

Returns

A PyGVisuals-design that is being used as fallback.

pygvisuals.designs.getDesignRegister()[source]

Return a copy of the design-register. As the register is a dict, this can be used to list all available designs, e.g.: getDesignRegister().items()

Returns

A dict which represents the design-register.

pygvisuals.designs.registerDesign(name, design)[source]

Register a design in the design-register.

Parameters
  • name – A string to use as a reference/name for the design in the register.

  • design – The design to register.

pygvisuals.designs.getRegisteredDesign(name)[source]

Return a design from the design-register by its reference.

Parameters

name – A string used as a reference/name for the design in the register.

Submodules

pygvisuals.designs.design module

class pygvisuals.designs.design.Design(fallback=None, **kwargs)[source]

Bases: object

Class implementing a design template for applications with widgets.

Initialisation of a Design. Designs bundle named attributes (just like any object) which can be accessed directly.

It includes methods to ‘apply’ the design to widgets. For any defined attribute in the design it will try to write it to given widgets, if the widget has that attribute (via hasattr(), setattr()).

Parameters
  • fallback – An object with readable attributes to be used, if an attribute was not found for this design. This will also be used when applying the design to widgets. If this is a falsy value (e.g. None), there will be no fallback-design.

  • **kwargs – Any key-value-pairs to add to this design’s attributes.

applyToWidget(widget)[source]

Apply this design to the supplied widget. For any defined attribute in the design, this will try to write it to given widget, if the widget has that attribute (via hasattr(), setattr()).

Parameters

widgets – A widgets to apply the design to.

applyToWidgets(widgets)[source]

Apply this design to the supplied widgets. For any defined attribute in the design, this will try to write it to given widgets, if the widget has that attribute (via hasattr(), setattr()).

Parameters

widgets – An iterable of widgets to apply the designs to.

copy()[source]

This calls the underlying __copy__-function.

Create a shallow copy of this design.

Returns

A new design-instance with the same attributes and fallback as this design.

pygvisuals.designs.hardcoded_designs module

A collection of designs for PyGVisuals.

pygvisuals.designs.hardcoded_designs.aqua

A design working with turquoise and sandy colors.

pygvisuals.designs.hardcoded_designs.classic

The default design hardcoded into PyGVisuals-widgets of older versions.

pygvisuals.designs.hardcoded_designs.dark

A dark design for PyGVisuals-widgets.

pygvisuals.designs.hardcoded_designs.hologram

A futuristic design for PyGVisuals-widgets; good for HUDs, etc.

pygvisuals.designs.hardcoded_designs.ice

A design for PyGVisuals-widgets based around cold colors.

pygvisuals.designs.hardcoded_designs.lavender

A sleek design with a floral color-palette.