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)
frameA Rect that indicates where on the parent Window the View should be. You should not specify a frame on a View that will be added to a parent which uses a Layout.
nameA string, the Button's internal name.
labelA string, the text that will be displayed on the Button.
messageA Message that will be sent when the Button is Invoked.
resizingModeAn integer, the resizing mode. (See the resizing mode constants.) Should only be specified when there is a frame. Defaults to
B_FOLLOW_NONE.flagsAn integer, view flags. (See the view flag constants.)
archiveA Message, contains an archived version of the Button.
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)
flagA boolean, the new state.
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)
flatA boolean, the new state.
Behavior
SetBehavior
Returns the Button's behavior.
Perl
$button->Behavior(); $button->SetBehavior($behavior);
Python
button.Behavior() button.SetBehavior(behavior)
behaviorAn integer, one of the behavior constants.
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.
- B_BUTTON_BEHAVIOR
- B_TOGGLE_BEHAVIOR
- B_POP_UP_BEHAVIOR
SCRIPTING SUITE
Button inherits the following suites: