ConstraintGuide#

class ConstraintGuide(**properties: Any)#

Superclasses: Object

Implemented Interfaces: ConstraintTarget

A GtkConstraintGuide is an invisible layout element in a GtkConstraintLayout.

The GtkConstraintLayout treats guides like widgets. They can be used as the source or target of a GtkConstraint.

Guides have a minimum, maximum and natural size. Depending on the constraints that are applied, they can act like a guideline that widgets can be aligned to, or like flexible space.

Unlike a GtkWidget, a GtkConstraintGuide will not be drawn.

Constructors#

class ConstraintGuide
classmethod new() ConstraintGuide#

Creates a new GtkConstraintGuide object.

Methods#

class ConstraintGuide
get_max_size() tuple[int, int]#

Gets the maximum size of guide.

get_min_size() tuple[int, int]#

Gets the minimum size of guide.

get_name() str | None#

Retrieves the name set using set_name().

get_nat_size() tuple[int, int]#

Gets the natural size of guide.

get_strength() ConstraintStrength#

Retrieves the strength set using set_strength().

set_max_size(width: int, height: int) None#

Sets the maximum size of guide.

If guide is attached to a GtkConstraintLayout, the constraints will be updated to reflect the new size.

Parameters:
  • width – the new maximum width, or -1 to not change it

  • height – the new maximum height, or -1 to not change it

set_min_size(width: int, height: int) None#

Sets the minimum size of guide.

If guide is attached to a GtkConstraintLayout, the constraints will be updated to reflect the new size.

Parameters:
  • width – the new minimum width, or -1 to not change it

  • height – the new minimum height, or -1 to not change it

set_name(name: str | None = None) None#

Sets a name for the given GtkConstraintGuide.

The name is useful for debugging purposes.

Parameters:

name – a name for the guide

set_nat_size(width: int, height: int) None#

Sets the natural size of guide.

If guide is attached to a GtkConstraintLayout, the constraints will be updated to reflect the new size.

Parameters:
  • width – the new natural width, or -1 to not change it

  • height – the new natural height, or -1 to not change it

set_strength(strength: ConstraintStrength) None#

Sets the strength of the constraint on the natural size of the given GtkConstraintGuide.

Parameters:

strength – the strength of the constraint

Properties#

class ConstraintGuide
props.max_height: int#

The type of the None singleton.

props.max_width: int#

The type of the None singleton.

props.min_height: int#

The type of the None singleton.

props.min_width: int#

The type of the None singleton.

props.name: str#

The type of the None singleton.

props.nat_height: int#

The type of the None singleton.

props.nat_width: int#

The type of the None singleton.

props.strength: ConstraintStrength#

The type of the None singleton.