Haiku API Bindings
MenuField
Not logged in

Documentation | InterfaceKit | MenuField

SYNOPSIS

Perl

use HaikuR1::MenuField;

my $menufield = HaikuR1::MenuField->new(
    frame => $frame,
    name  => $name,
    flags => $flags,
    menu  => $menu,
    label => $label,
);
$window->AddChild($menufield);

Python

import HaikuR1.MenuField

menufield = MenuField(
    frame = frame,
    name  = name,
    flags = flags,
    menu  = menu,
    label = label,
)
window.AddChild(menufield)

DESCRIPTION

Exposes the BMenuField object.

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

METHODS

Constructor

Creates a MenuField.

Perl

HaikuR1::MenuField->new(
    frame => $frame,
    name => $name,
    label => $label,
    menu => $menu,
    resizingMode => $resizingMode,
    flags => $flags,
);

Python

MenuField(
    frame = frame,
    name = name,
    label = label,
    menu = menu,
    resizingMode = resizingMode,
    flags = flags,
)

Alignment

SetAlignment

Gets or sets the MenuField's alignment.

Perl

$menufield->Alignment();
$menufield->SetAlignment($flag);

Python

menufield.Alignment()
menufield.SetAlignment(flag)

Divider

SetDivider

Gets or sets the position of the divider between the label and the menu.

Perl

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

Python

menufield.Divider()
menufield.SetDivider(xCoordinate)

Enabled state

IsEnabled

SetEnabled

Returns true if the MenuField is enabled.

Gets or sets the MenuField's enabled state. SetEnabled can also be called as a hook.

Perl

$menufield->IsEnabled();
$menufield->SetEnabled($enabled);

Python

menufield.IsEnabled()
menufield.SetEnabled(enabled)

Label

SetLabel

Gets or sets the label. SetLabel can also be called as a hook.

Perl

$menufield->Label();
$menufield->SetLabel($string);

Python

menufield.Label()
menufield.SetLabel(string)

Menu

Returns the Menu associated with the MenuField.

Perl

$menufield->Menu();

Python

menufield.Menu()

MenuBar

Returns the MenuBar created during construction to hold the Menu.

Perl

$menufield->MenuBar();

Python

menufield.MenuBar()

MenuItem

Returns the first MenuItem from the Menu.

Perl

$menufield->MenuItem();

Python

menufield.MenuItem()

Popup marker

ShowPopUpMarker

HidePopUpMarker

Shows or hides the popup marker at the edge of the MenuField.

Perl

$menufield->ShowPopUpMarker();
$menufield->HidePopUpMarker();

Python

menufield.ShowPopUpMarker()
menufield.HidePopUpMarker()

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.

SCRIPTING SUITE

Button inherits the following suites: