Haiku API Bindings
PopUpMenu
Not logged in

Documentation | InterfaceKit | PopUpMenu

SYNOPSIS

Perl

use HaikuR1::PopUpMenu;

my $popup = HaikuR1::PopUpMenu->new(
    name => $name
)
$popup->Go();

Python

from HaikuR1.InterfaceKit import PopUpMenu

popup = PopUpMenu(
    name = name
)
popup.Go()

DESCRIPTION

Exposes the BPopUpMenu object.

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

METHODS

Constructor

Creates a PopUpMenu.

Perl

HaikuR1::PopUpMenu->new(
    name => $name,
    radioMode => $radioMode,
    labelFromMarked => $labelFromMarked,
    layout => $layout,
);

Python

PopUpMenu(
    name = name,
    radioMode = radioMode,
    labelFromMarked = labelFromMarked,
    layout = layout,
)

AsyncAutoDestruct

SetAsyncAutoDestruct

Enables or disables auto-destruct for the PopUpMenu; of true, the associated Menu is deleted when the PopUpMenu closes. Defaults to false (which is usually what you want).

Perl

$popupmenu->AsyncAutoDestruct();
$popupmenu->SetAsyncAutoDestruct($state);

Python

popupmenu.AsyncAutoDestruct()
popupmenu.SetAsyncAutoDestruct(state)

Go

Displays the PopUpMenu. Returns the MenuItem that was selected, or the empty value if no item was selected.

Perl

$popupmenu->Go(
    where           => $screenPoint,
    deliversMessage => $deliversMessage,
    openAnyway      => $openAnyway,
    clickToOpenRect => $clickToOpenRect,
    asynchronous    => $asynchronous,
);

Python

popupmenu.Go(
    where           = screenPoint,
    deliversMessage = deliversMessage,
    openAnyway      = openAnyway,
    clickToOpenRect = clickToOpenRect,
    asynchronous    = asynchronous,
)

ScreenLocation

Returns the PopUpMenu's location on the screen, as a Point. Meant to be used from within hooks.

Perl

$popupmenu->ScreenLocation();

Python

popupmenu.ScreenLocation()

ARCHIVABLE INTERFACE

PopUpMenu inherits the methods and hooks of Archivable.

HANDLER INTERFACE

PopUpMenu inherits the methods and hooks of Handler.

VIEW INTERFACE

PopUpMenu inherits the methods and hooks of View.

MENU INTERFACE

PopUpMenu inherits the methods and hooks of Menu.

SCRIPTING SUITE

PopUpMenu inherits the following suites: