Documentation | InterfaceKit | MenuBar
SYNOPSIS
Perl
use HaikuR1::MenuBar qw(B_BORDER_FRAME B_BORDER_CONTENTS B_BORDER_EACH_ITEM); my $menubar = HaikuR1::MenuBar->new( frame => $frame, name => $name, resizingMode => $resizingMode, layout => $layout, resizeToFit => $resizeToFit, flags => $flags, ); $menubar->AddChild($item);
Python
from HaikuR1.InterfaceKit import MenuBar, B_BORDER_FRAME, B_BORDER_CONTENTS, B_BORDER_EACH_ITEM menubar = MenuBar( frame = frame, name = name, resizingMode = resizingMode, layout = layout, resizeToFit = resizeToFit, flags = flags, ) menubar.AddChild(item)
DESCRIPTION
Exposes the BMenuBar
object.
For more information on MenuBar, see the Be Book class description, the Be Book overview, and the Haiku Book class description.
METHODS
Constructor
Creates a MenuBar.
Perl
HaikuR1::MenuBar->new( frame => $frame, name => $name, resizingMode => $resizingMode, layout => $layout, resizeToFit => $resizeToFit, ); HaikuR1::MenuBar->new( name => $name, layout => $layout, flags => $flags, ); HaikuR1::MenuBar->new($archive);
Python
MenuBar( frame = frame, name = name, resizingMode = resizingMode, layout = layout, resizeToFit = resizeToFit, ) MenuBar( name = name, layout = layout, flags = flags, ) MenuBar(archive)
frame
A 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.
name
A string, the Menu name. (If this Menu is a submenu of another Menu, the name will be used as the initial label of the controlling MenuItem.)
resizingMode
An integer, the resizing mode. (See the resizing mode constants.) Should only be specified when there is a frame. Defaults to
B_FOLLOW_NONE
.layout
Either
B_ITEMS_IN_ROW
orB_ITEMS_IN_COLUMN
; defaults toB_ITEMS_IN_ROW
.resizeToFit
A boolean; if true, the MenuBar will repsect the top left corner of the
frame
, but it will ignore the width and height and resize itself to fit the MenuItems that are added to it.flags
An integer, view flags. (See the view flag constants.)
archive
A Message, contains an archived version of the MenuBar.
Border
SetBorder
Gets or sets the border for the MenuBar.
Perl
$menubar->Border(); $menubar->SetBorder($border);
Python
menubar.Border() menubar.SetBorder(border)
border
An integer, one of the MenuBar border constants.
Borders
SetBorders
Gets or sets the borders for the MenuBar; this method is used with Layout-enabled B_ITEMS_IN_ROW.
Perl
$menubar->Borders(); $menubar->SetBorders($borders);
Python
menubar.Borders() menubar.SetBorders(borders)
borders
An integer combination of the ControlLook border constants.
ARCHIVABLE INTERFACE
MenuBar
inherits the methods and hooks of Archivable.
HANDLER INTERFACE
MenuBar
inherits the methods and hooks of Handler.
VIEW INTERFACE
MenuBar
inherits the methods and hooks of View.
MENU INTERFACE
MenuBar
inherits the methods and hooks of Menu.
CONSTANTS
MenuBar border
Perl
use HaikuR1::MenuBar qw(:menu_bar_border)
Python
Python does not support export tags.
B_BORDER_FRAME
The border is drawn around the entire frame rectangle.
B_BORDER_CONTENTS
The border is drawn around just the list of items.
B_BORDER_EACH_ITEM
A border is drawn around each item.
SCRIPTING SUITE
MenuBar inherits the following suites: