ConstraintGuide#
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_name() str | None #
Retrieves the name set using
set_name()
.
- 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 aGtkConstraintLayout
, 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 aGtkConstraintLayout
, 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 aGtkConstraintLayout
, 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.strength: ConstraintStrength#
The type of the None singleton.