Gtk.Misc

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget Gtk.Misc Gtk.Misc Gtk.Widget->Gtk.Misc

Subclasses:

Gtk.Arrow, Gtk.Image, Gtk.Label

Methods

Inherited:

Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

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

get_alignment ()

get_padding ()

set_alignment (xalign, yalign)

set_padding (xpad, ypad)

Virtual Methods

Inherited:

Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.Widget (39)

Name

Type

Flags

Short Description

xalign

float

d/r/w

The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts. deprecated

xpad

int

d/r/w

The amount of space to add on the left and right of the widget, in pixels deprecated

yalign

float

d/r/w

The vertical alignment, from 0 (top) to 1 (bottom) deprecated

ypad

int

d/r/w

The amount of space to add on the top and bottom of the widget, in pixels deprecated

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

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

Fields

Inherited:

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

Name

Type

Access

Description

widget

Gtk.Widget

r

Class Details

class Gtk.Misc(**kwargs)
Bases:

Gtk.Widget

Abstract:

Yes

Structure:

Gtk.MiscClass

The Gtk.Misc widget is an abstract widget which is not useful itself, but is used to derive subclasses which have alignment and padding attributes.

The horizontal and vertical padding attributes allows extra space to be added around the widget.

The horizontal and vertical alignment attributes enable the widget to be positioned within its allocated area. Note that if the widget is added to a container in such a way that it expands automatically to fill its allocated area, the alignment settings will not alter the widget’s position.

Note that the desired effect can in most cases be achieved by using the Gtk.Widget :halign, Gtk.Widget :valign and Gtk.Widget :margin properties on the child widget, so Gtk.Misc should not be used in new code. To reflect this fact, all Gtk.Misc API has been deprecated.

get_alignment()[source]
Returns:

xalign:

location to store X alignment of self, or None

yalign:

location to store Y alignment of self, or None

Return type:

(xalign: float, yalign: float)

Gets the X and Y alignment of the widget within its allocation. See Gtk.Misc.set_alignment().

Deprecated since version 3.14: Use Gtk.Widget alignment and margin properties.

get_padding()[source]
Returns:

xpad:

location to store padding in the X direction, or None

ypad:

location to store padding in the Y direction, or None

Return type:

(xpad: int, ypad: int)

Gets the padding in the X and Y directions of the widget. See Gtk.Misc.set_padding().

Deprecated since version 3.14: Use Gtk.Widget alignment and margin properties.

set_alignment(xalign, yalign)[source]
Parameters:
  • xalign (float) – the horizontal alignment, from 0 (left) to 1 (right).

  • yalign (float) – the vertical alignment, from 0 (top) to 1 (bottom).

Sets the alignment of the widget.

Deprecated since version 3.14: Use Gtk.Widget's alignment (Gtk.Widget :halign and Gtk.Widget :valign) and margin properties or Gtk.Label's Gtk.Label :xalign and Gtk.Label :yalign properties.

set_padding(xpad, ypad)[source]
Parameters:
  • xpad (int) – the amount of space to add on the left and right of the widget, in pixels.

  • ypad (int) – the amount of space to add on the top and bottom of the widget, in pixels.

Sets the amount of space to add around the widget.

Deprecated since version 3.14: Use Gtk.Widget alignment and margin properties.

Property Details

Gtk.Misc.props.xalign
Name:

xalign

Type:

float

Default Value:

0.5

Flags:

DEPRECATED, READABLE, WRITABLE

The horizontal alignment. A value of 0.0 means left alignment (or right on RTL locales); a value of 1.0 means right alignment (or left on RTL locales).

Deprecated since version 3.14: Use Gtk.Widget.set_halign() instead. If you are using Gtk.Label, use Gtk.Label :xalign instead.

Gtk.Misc.props.xpad
Name:

xpad

Type:

int

Default Value:

0

Flags:

DEPRECATED, READABLE, WRITABLE

The amount of space to add on the left and right of the widget, in pixels.

Deprecated since version 3.14: Use Gtk.Widget.set_margin_start() and Gtk.Widget.set_margin_end() instead

Gtk.Misc.props.yalign
Name:

yalign

Type:

float

Default Value:

0.5

Flags:

DEPRECATED, READABLE, WRITABLE

The vertical alignment. A value of 0.0 means top alignment; a value of 1.0 means bottom alignment.

Deprecated since version 3.14: Use Gtk.Widget.set_valign() instead. If you are using Gtk.Label, use Gtk.Label :yalign instead.

Gtk.Misc.props.ypad
Name:

ypad

Type:

int

Default Value:

0

Flags:

DEPRECATED, READABLE, WRITABLE

The amount of space to add on the top and bottom of the widget, in pixels.

Deprecated since version 3.14: Use Gtk.Widget.set_margin_top() and Gtk.Widget.set_margin_bottom() instead