Haiku API Bindings
Size
Not logged in

Documentation | InterfaceKit | Size

SYNOPSIS

Perl

use HaikuR1::Size qw(B_SIZE_UNSET B_SIZE_UNLIMITED);

my $size = HaikuR1::Size->new($width, $height);

Python

from HaikuR1.InterfaceKit import Size, B_SIZE_UNSET, B_SIZE_UNLIMITED

size = Size(width, height)

DESCRIPTION

Exposes the BSize object.

As a convenience, wherever a method expects a Size as input, you may pass a two-item native list or native map instead. In addition, you may treat a Size object like a native list.

For more information on Size, see the Haiku Book class description.

Perl

# input converter
$message->AddSize("size", [$width,$height]);
$message->AddSize("size", {
    $width,
    $height
});

# list accessors
$size->[0] = $width2;
$size->[1] = $height2;

Python

# input converter
message.AddSize("size", [width,height])
message.AddSize("size", {
    width,
    height
})

# list accessors
size[0] = width2
size[1] = height2

PROPERTIES

width

A floating point number.

height

A floating point number.

METHODS

Constructor

Creates a Size object.

Perl

HaikuR1::Size->new($width, $height);
HaikuR1::Size->new($copy_from);
HaikuR1::Size->new();

Python

Size(width, height)
Size(copy_from)
Size()

copy

Copies the contents of another object into this object.

Perl

$size->copy($copy_from);

Python

size.copy(copy_from)

Width and Height

Set

Width

IntegerWidth

SetWidth

IsWidthSet

Height

SetHeight

IntegerHeight

IsHeightSet

These methods do what you expect.

Perl

$size->Set($width, $height);

$size->Width();
$size->IntegerWidth();
$size->SetWidth($width);
$size->IsWidthSet();

$size->Height();
$size->IntegerHeight();
$size->SetHeight($height);
$size->IsHeightSet();

Python

size.Set(width, height)

size.Width()
size.IntegerWidth()
size.SetWidth(width)
size.IsWidthSet()

size.Height()
size.IntegerHeight()
size.SetHeight(height)
size.IsHeightSet()

OPERATORS

==

Returns true if the Size objects have the same dimensions.

!=

Returns true if the Size objects do not have the same dimensions.

CONSTANTS