Haiku API Bindings
Button
Not logged in

Documentation | InterfaceKit | Button

SYNOPSIS

Perl

use HaikuR1::Button qw(B_BUTTON_BEHAVIOR B_TOGGLE_BEHAVIOR B_POP_UP_BEHAVIOR);

my $button = HaikuR1::Button->new(
    frame => $frame,
    name => $name,
    label => $label,
    message => $message,
    resizingMode => $resizingMode,
    flags => $flags,
);
$window->AddChild($button);

Python

from HaikuR1.InterfaceKit import Button, B_BUTTON_BEHAVIOR, B_TOGGLE_BEHAVIOR, B_POP_UP_BEHAVIOR

button = Button(
    frame = frame,
    name = name,
    label = label,
    message = message,
    resizingMode = resizingMode,
    flags = flags,
)
window.AddChild(button)

DESCRIPTION

Exposes the BButton object.

For more information on Button, see the Be Book class description, the Be Book overview, and the Haiku Book class description.

METHODS

Constructor

Creates a Button.

Perl

HaikuR1::Button->new(
    frame        => $frame,
    name         => $name,
    label        => $label,
    message      => $message,
    resizingMode => $resizingMode,
    flags        => $flags,
);
HaikuR1::Button->new($archive);

Python

Button(
    frame        = frame,
    name         = name,
    label        = label,
    message      = message,
    resizingMode = resizingMode,
    flags        = flags,
)
Button(archive)

Default state

IsDefault

MakeDefault

Gets or sets the button's default state (that is, whether or not it is the default button). MakeDefault can also be called as a hook.

Perl

$button->IsDefault();
$button->MakeDefault($flag);

Python

button.IsDefault()
button.MakeDefault(flag)

Flat state

IsFlat

SetFlat

Gets or sets the button's flat state (i.e., whether or not the button has a "flat" look).

Perl

$button->IsFlat();
$button->SetFlat($flat);

Python

button.IsFlat()
button.SetFlat(flat)

Behavior

SetBehavior

Returns the Button's behavior.

Perl

$button->Behavior();
$button->SetBehavior($behavior);

Python

button.Behavior()
button.SetBehavior(behavior)

PopUpMessage

SetPopUpMessage

Returns the Button's popup Message.

Perl

$button->PopUpMessage();
$button->SetPopUpMessage($message);

Python

button.PopUpMessage()
button.SetPopUpMessage(message)

ARCHIVABLE INTERFACE

Button inherits the methods and hooks of Archivable.

HANDLER INTERFACE

Button inherits the methods and hooks of Handler.

VIEW INTERFACE

Button inherits the methods and hooks of View.

CONTROL INTERFACE

Button inherits the methods and hooks of Control.

CONSTANTS

Button behavior

Perl

use HaikuR1::Button qw(:behavior)

Python

Python does not support export tags.

SCRIPTING SUITE

Button inherits the following suites: