Haiku API Bindings
TextControl
Not logged in

Documentation | InterfaceKit | TextControl

SYNOPSIS

Perl

use HaikuR1::TextControl;

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

Python

import HaikuR1.TextControl []

textcontrol = TextControl(
    frame = frame,
    name = name,
    label = label,
    text = text,
    message = message,
    resizingMode = resizingMode,
    flags = flags,
)
window.AddChild(textcontrol)

DESCRIPTION

Exposes the BTextControl object.

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

METHODS

Constructor

Creates a TextControl.

Perl

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

Python

TextControl(
    frame = frame,
    name = name,
    label = label,
    text = text,
    message = message,
    resizingMode = resizingMode,
    flags = flags,
)
TextControl.FromArchive(archive)

Text

SetText

TextLength

Gets or sets the text in the input field. SetText can also be called as a hook.

Perl

$textcontrol->Text();
$textcontrol->SetText($text);
$textcontrol->TextLength();

Python

textcontrol.Text()
textcontrol.SetText(text)
textcontrol.TextLength()

MarkAsInvalid

Marks the control as invalid; this changes its appearance.

Perl

$textcontrol->MarkAsInvalid($invalid);

Python

textcontrol.MarkAsInvalid(invalid)

TextView

Returns the TextView input field.

Perl

$textcontrol->TextView();

Python

textcontrol.TextView()

ModificationMessage

SetModificationMessage

Gets or sets the message sent when the content changes. SetModificationMessage can also be called as a hook.

Perl

$textcontrol->ModificationMessage();
$textcontrol->SetModificationMessage($message);

Python

textcontrol.ModificationMessage()
textcontrol.SetModificationMessage(message)

Alignment

GetAlignment

SetAlignment

Gets or sets the alignment for the TextControl's input field and label. SetAlignment can also be called as a hook. GetAlignment returns two values.

Perl

$textcontrol->GetAlignment();
$textcontrol->SetAlignment($forLabel, $forText);

Python

textcontrol.GetAlignment()
textcontrol.SetAlignment(forLabel, forText)

Divider

SetDivider

Gets or sets the divider point between the label and the TextView; this is the x-coordinate where the label stops and the input field begins.

Perl

$textcontrol->Divider();
$textcontrol->SetDivider($xCoordinate);

Python

textcontrol.Divider()
textcontrol.SetDivider(xCoordinate)

Layout items

CreateLabelLayoutItem

CreateTextViewLayoutItem

Creates LayoutItems for the internal Views.

Perl

$textcontrol->CreateLabelLayoutItem();
$textcontrol->CreateTextViewLayoutItem();

Python

textcontrol.CreateLabelLayoutItem()
textcontrol.CreateTextViewLayoutItem()

ARCHIVABLE INTERFACE

TextControl inherits the methods and hooks of Archivable.

HANDLER INTERFACE

TextControl inherits the methods and hooks of Handler.

VIEW INTERFACE

TextControl inherits the methods and hooks of View.

CONTROL INTERFACE

TextControl inherits the methods and hooks of Control.

SCRIPTING SUITE

TextControl inherits the following suites:

However, TextControl overrides the Control suite so that the Value property is a string instead of an integer.