Gtk.ConstraintGuide

g GObject.GInterface GObject.GInterface Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.Object GObject.Object Gtk.ConstraintGuide Gtk.ConstraintGuide GObject.Object->Gtk.ConstraintGuide Gtk.ConstraintTarget->Gtk.ConstraintGuide

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_max_size ()

get_min_size ()

get_name ()

get_nat_size ()

get_strength ()

set_max_size (width, height)

set_min_size (width, height)

set_name (name)

set_nat_size (width, height)

set_strength (strength)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

max-height

int

r/w/en

max-width

int

r/w/en

min-height

int

r/w/en

min-width

int

r/w/en

name

str

r/w

nat-height

int

r/w/en

nat-width

int

r/w/en

strength

Gtk.ConstraintStrength

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gtk.ConstraintGuide(**kwargs)
Bases:

GObject.Object, Gtk.ConstraintTarget

Abstract:

No

Structure:

Gtk.ConstraintGuideClass

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.

classmethod new()[source]
Returns:

a new GtkConstraintGuide object.

Return type:

Gtk.ConstraintGuide

Creates a new GtkConstraintGuide object.

get_max_size()[source]
Returns:

width:

return location for the maximum width

height:

return location for the maximum height

Return type:

(width: int, height: int)

Gets the maximum size of self.

get_min_size()[source]
Returns:

width:

return location for the minimum width

height:

return location for the minimum height

Return type:

(width: int, height: int)

Gets the minimum size of self.

get_name()[source]
Returns:

the name of the guide

Return type:

str or None

Retrieves the name set using Gtk.ConstraintGuide.set_name().

get_nat_size()[source]
Returns:

width:

return location for the natural width

height:

return location for the natural height

Return type:

(width: int, height: int)

Gets the natural size of self.

get_strength()[source]
Returns:

the strength of the constraint on the natural size

Return type:

Gtk.ConstraintStrength

Retrieves the strength set using Gtk.ConstraintGuide.set_strength().

set_max_size(width, height)[source]
Parameters:
  • width (int) – the new maximum width, or -1 to not change it

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

Sets the maximum size of self.

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

set_min_size(width, height)[source]
Parameters:
  • width (int) – the new minimum width, or -1 to not change it

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

Sets the minimum size of self.

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

set_name(name)[source]
Parameters:

name (str or None) – a name for the self

Sets a name for the given GtkConstraintGuide.

The name is useful for debugging purposes.

set_nat_size(width, height)[source]
Parameters:
  • width (int) – the new natural width, or -1 to not change it

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

Sets the natural size of self.

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

set_strength(strength)[source]
Parameters:

strength (Gtk.ConstraintStrength) – the strength of the constraint

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

Property Details

Gtk.ConstraintGuide.props.max_height
Name:

max-height

Type:

int

Default Value:

2147483647

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The maximum height of the guide.

Gtk.ConstraintGuide.props.max_width
Name:

max-width

Type:

int

Default Value:

2147483647

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The maximum width of the guide.

Gtk.ConstraintGuide.props.min_height
Name:

min-height

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The minimum height of the guide.

Gtk.ConstraintGuide.props.min_width
Name:

min-width

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The minimum width of the guide.

Gtk.ConstraintGuide.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

A name that identifies the GtkConstraintGuide, for debugging.

Gtk.ConstraintGuide.props.nat_height
Name:

nat-height

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The preferred, or natural, height of the guide.

Gtk.ConstraintGuide.props.nat_width
Name:

nat-width

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The preferred, or natural, width of the guide.

Gtk.ConstraintGuide.props.strength
Name:

strength

Type:

Gtk.ConstraintStrength

Default Value:

Gtk.ConstraintStrength.MEDIUM

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The GtkConstraintStrength to be used for the constraint on the natural size of the guide.