Haiku API Bindings
PictureButton
Not logged in

Documentation | InterfaceKit | PictureButton

SYNOPSIS

Perl

use HaikuR1::PictureButton [];

HaikuR1::PictureButton->new(
    frame => $frame,
    name => $name,
    off => $off,
    on => $on,
    message => $message,
    behavior => $behavior,
    resizingMode => $resizingMode,
    flags => $flags,
);
$window->AddChild($button);

Python

import HaikuR1.PictureButton []

button = Button(
    frame = frame,
    name = name,
    off = off,
    on = on,
    message = message,
    behavior = behavior,
    resizingMode = resizingMode,
    flags = flags,
)
window.AddChild(button)

DESCRIPTION

Exposes the BPictureButton object.

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

METHODS

Constructor

Creates a PictureButton.

Perl

HaikuR1::PictureButton->new(
    frame => $frame,
    name => $name,
    off => $off,
    on => $on,
    message => $message,
    behavior => $behavior,
    resizingMode => $resizingMode,
    flags => $flags,
);
HaikuR1::PictureButton->new($archive);

Python

PictureButton(
    frame = frame,
    name = name,
    off = off,
    on = on,
    message = message,
    behavior = behavior,
    resizingMode = resizingMode,
    flags = flags,
)
PictureButton(archive)

Behavior

SetBehavior

Gets or sets the button behavior.

Perl

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

Python

picturebutton.Behavior()
picturebutton.SetBehavior(behavior)

Pictures

EnabledOn

SetEnabledOn

EnabledOff

SetEnabledOff

DisabledOn

SetDisabledOn

DisabledOff

SetDisabledOff

Gets or sets the picture for the given state. The Set... methods can also be called as hooks.

The Disabled images cannot be set by the constructor, so if you are going to disable your button for any reason, you must set them via this function. (However, DisabledOff is not a valid state when the behavior is B_ONE_STATE_BUTTON, so you won't need that image in that case.)

Note: There is no way to unset a Picture once set; passing the empty value to this method will cause your application to crash.

Perl

$picturebutton->EnabledOn();
$picturebutton->SetEnabledOn($on);
$picturebutton->EnabledOff();
$picturebutton->SetEnabledOff($off);
$picturebutton->DisabledOn();
$picturebutton->SetDisabledOn($on);
$picturebutton->DisabledOff();
$picturebutton->SetDisabledOff($off);

Python

picturebutton.EnabledOn()
picturebutton.SetEnabledOn(on)
picturebutton.EnabledOff()
picturebutton.SetEnabledOff(off)
picturebutton.DisabledOn()
picturebutton.SetDisabledOn(on)
picturebutton.DisabledOff()
picturebutton.SetDisabledOff(off)

ARCHIVABLE INTERFACE

PictureButton inherits the methods and hooks of Archivable.

HANDLER INTERFACE

PictureButton inherits the methods and hooks of Handler.

VIEW INTERFACE

PictureButton inherits the methods and hooks of View.

CONTROL INTERFACE

PictureButton inherits the methods and hooks of Control.

CONSTANTS

Button behavior

Perl

use HaikuR1::PictureButton qw(:behavior)

Python

Python does not support export tags.

SCRIPTING SUITE

PictureButton inherits the following suites: