ClapperGtk.Container

g ClapperGtk.Container ClapperGtk.Container GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Widget->ClapperGtk.Container

Subclasses:

ClapperGtk.Billboard, ClapperGtk.LeadContainer, ClapperGtk.SimpleControls

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

get_adaptive_height ()

get_adaptive_width ()

get_child ()

get_height_target ()

get_width_target ()

set_adaptive_height (height)

set_adaptive_width (width)

set_child (child)

set_height_target (height)

set_width_target (width)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

adaptive-height

int

r/w/en

adaptive-width

int

r/w/en

height-target

int

r/w/en

width-target

int

r/w/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

adapt

A helper signal for implementing mobile/narrow adaptive behavior on descendants.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gtk.Widget

r

Class Details

class ClapperGtk.Container(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

ClapperGtk.ContainerClass

A simple container widget that holds just one child.

It is designed to work well with OSD overlay, adding some useful functionalities to it, such as width and height that widget should target. This helps with implementing simple adaptive widgets by observing its own width and signalling when adaptive threshold is reached.

You can use this when you need to create a widget that is adaptive or should have a limited maximal width/height.

If you need to have more then single widget as child, place a widget that can hold multiple children such as [class`Gtk`.Box] as a single conatiner child and then your widgets into that child.

classmethod new()
Returns:

a new container Gtk.Widget.

Return type:

Gtk.Widget

Creates a new ClapperGtk.Container instance.

get_adaptive_height()
Returns:

adaptive height set by user or -1 when none.

Return type:

int

Get a self adaptive height threshold.

get_adaptive_width()
Returns:

adaptive width set by user or -1 when none.

Return type:

int

Get a self adaptive width threshold.

get_child()
Returns:

Gtk.Widget set as child.

Return type:

Gtk.Widget or None

Get a child Gtk.Widget of self.

get_height_target()
Returns:

height target set by user or -1 when none.

Return type:

int

Get a self height target.

get_width_target()
Returns:

width target set by user or -1 when none.

Return type:

int

Get a self width target.

set_adaptive_height(height)
Parameters:

height (int) – a threshold on which adapt signal should be triggered or -1 to disable.

Set an adaptive height threshold. When widget is resized to value or lower, an [signal`ClapperGtk`.Container::adapt] signal will be emitted with True to notify implementation about mobile adaptation request, otherwise False when both threshold values are exceeded.

set_adaptive_width(width)
Parameters:

width (int) – a threshold on which adapt signal should be triggered or -1 to disable.

Set an adaptive width threshold. When widget is resized to value or lower, an [signal`ClapperGtk`.Container::adapt] signal will be emitted with True to notify implementation about mobile adaptation request, otherwise False when both threshold values are exceeded.

set_child(child)
Parameters:

child (Gtk.Widget) – a Gtk.Widget

Set a child Gtk.Widget of self.

set_height_target(height)
Parameters:

height (int) – height to target or -1 to restore default behavior

Same as ClapperGtk.Container.set_width_target() but for widget height.

set_width_target(width)
Parameters:

width (int) – width to target -1 to restore default behavior

Set a width that self should target. When set container will not stretch beyond set width while still expanding into possible boundaries trying to reach its target.

Signal Details

ClapperGtk.Container.signals.adapt(container, adapt)
Signal Name:

adapt

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:

A helper signal for implementing mobile/narrow adaptive behavior on descendants.

Property Details

ClapperGtk.Container.props.adaptive_height
Name:

adaptive-height

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Adaptive height threshold that triggers [signal`ClapperGtk`.Container::adapt] signal.

ClapperGtk.Container.props.adaptive_width
Name:

adaptive-width

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Adaptive width threshold that triggers [signal`ClapperGtk`.Container::adapt] signal.

ClapperGtk.Container.props.height_target
Name:

height-target

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Height that container should target.

ClapperGtk.Container.props.width_target
Name:

width-target

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Width that container should target.