ClapperGtk.Container¶
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
A helper signal for implementing mobile/narrow adaptive behavior on descendants. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class ClapperGtk.Container(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
Creates a new
ClapperGtk.Container
instance.
- get_adaptive_height()¶
- Returns:
adaptive height set by user or -1 when none.
- Return type:
Get a self adaptive height threshold.
- get_adaptive_width()¶
- Returns:
adaptive width set by user or -1 when none.
- Return type:
Get a self adaptive width threshold.
- get_child()¶
- Returns:
Gtk.Widget
set as child.- Return type:
Gtk.Widget
orNone
Get a child
Gtk.Widget
of self.
- get_height_target()¶
- Returns:
height target set by user or -1 when none.
- Return type:
Get a self height target.
- get_width_target()¶
- Returns:
width target set by user or -1 when none.
- Return type:
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, otherwiseFalse
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, otherwiseFalse
when both threshold values are exceeded.
- set_child(child)¶
- Parameters:
child (
Gtk.Widget
) – aGtk.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.
Signal Details¶
- ClapperGtk.Container.signals.adapt(container, adapt)¶
- Signal Name:
adapt
- Flags:
- Parameters:
container (
ClapperGtk.Container
) – The object which received the signaladapt (
bool
) –True
if narrowness reached adaptive threshold,False
otherwise
A helper signal for implementing mobile/narrow adaptive behavior on descendants.
Property Details¶
- ClapperGtk.Container.props.adaptive_height¶
- Name:
adaptive-height
- Type:
- Default Value:
-1
- Flags:
Adaptive height threshold that triggers [signal`ClapperGtk`.Container::adapt] signal.
- ClapperGtk.Container.props.adaptive_width¶
- Name:
adaptive-width
- Type:
- Default Value:
-1
- Flags:
Adaptive width threshold that triggers [signal`ClapperGtk`.Container::adapt] signal.
- ClapperGtk.Container.props.height_target¶
- Name:
height-target
- Type:
- Default Value:
-1
- Flags:
Height that container should target.
- ClapperGtk.Container.props.width_target¶
- Name:
width-target
- Type:
- Default Value:
-1
- Flags:
Width that container should target.