---
id: "rnmenubar"
title: "RNMenuBar"
sidebar_label: "RNMenuBar"
---

## Hierarchy

* QMenuBar

  ↳ **RNMenuBar**

## Implements

* RNWidget

## Index

### Constructors

* [constructor](rnmenubar.md#constructor)

### Properties

* [_menus](rnmenubar.md#_menus)
* [_rawInlineStyle](rnmenubar.md#_rawinlinestyle)
* [actions](rnmenubar.md#actions)
* [layout](rnmenubar.md#optional-layout)
* [native](rnmenubar.md#native)
* [nodeChildren](rnmenubar.md#nodechildren)
* [nodeParent](rnmenubar.md#optional-nodeparent)
* [type](rnmenubar.md#type)
* [tagName](rnmenubar.md#static-tagname)

### Methods

* [acceptDrops](rnmenubar.md#acceptdrops)
* [activateWindow](rnmenubar.md#activatewindow)
* [addAction](rnmenubar.md#addaction)
* [addEventListener](rnmenubar.md#addeventlistener)
* [addMenu](rnmenubar.md#addmenu)
* [addSeparator](rnmenubar.md#addseparator)
* [adjustSize](rnmenubar.md#adjustsize)
* [appendChild](rnmenubar.md#appendchild)
* [appendInitialChild](rnmenubar.md#appendinitialchild)
* [close](rnmenubar.md#close)
* [font](rnmenubar.md#font)
* [geometry](rnmenubar.md#geometry)
* [getFlexNode](rnmenubar.md#getflexnode)
* [hasMouseTracking](rnmenubar.md#hasmousetracking)
* [hide](rnmenubar.md#hide)
* [inherits](rnmenubar.md#inherits)
* [insertBefore](rnmenubar.md#insertbefore)
* [isEnabled](rnmenubar.md#isenabled)
* [isVisible](rnmenubar.md#isvisible)
* [lower](rnmenubar.md#lower)
* [mapFromGlobal](rnmenubar.md#mapfromglobal)
* [mapFromParent](rnmenubar.md#mapfromparent)
* [mapToGlobal](rnmenubar.md#maptoglobal)
* [mapToParent](rnmenubar.md#maptoparent)
* [maximumSize](rnmenubar.md#maximumsize)
* [minimumSize](rnmenubar.md#minimumsize)
* [move](rnmenubar.md#move)
* [objectName](rnmenubar.md#objectname)
* [pos](rnmenubar.md#pos)
* [property](rnmenubar.md#property)
* [raise](rnmenubar.md#raise)
* [removeAction](rnmenubar.md#removeaction)
* [removeChild](rnmenubar.md#removechild)
* [removeEventListener](rnmenubar.md#removeeventlistener)
* [repaint](rnmenubar.md#repaint)
* [repolish](rnmenubar.md#repolish)
* [resize](rnmenubar.md#resize)
* [setAcceptDrops](rnmenubar.md#setacceptdrops)
* [setAttribute](rnmenubar.md#setattribute)
* [setContextMenuPolicy](rnmenubar.md#setcontextmenupolicy)
* [setCursor](rnmenubar.md#setcursor)
* [setEnabled](rnmenubar.md#setenabled)
* [setFixedSize](rnmenubar.md#setfixedsize)
* [setFlexNodeSizeControlled](rnmenubar.md#setflexnodesizecontrolled)
* [setFocus](rnmenubar.md#setfocus)
* [setFont](rnmenubar.md#setfont)
* [setGeometry](rnmenubar.md#setgeometry)
* [setGraphicsEffect](rnmenubar.md#setgraphicseffect)
* [setInlineStyle](rnmenubar.md#setinlinestyle)
* [setLayout](rnmenubar.md#setlayout)
* [setMaximumSize](rnmenubar.md#setmaximumsize)
* [setMinimumSize](rnmenubar.md#setminimumsize)
* [setMouseTracking](rnmenubar.md#setmousetracking)
* [setNativeMenuBar](rnmenubar.md#setnativemenubar)
* [setNodeParent](rnmenubar.md#setnodeparent)
* [setObjectName](rnmenubar.md#setobjectname)
* [setProperty](rnmenubar.md#setproperty)
* [setProps](rnmenubar.md#setprops)
* [setStyleSheet](rnmenubar.md#setstylesheet)
* [setWindowFlag](rnmenubar.md#setwindowflag)
* [setWindowIcon](rnmenubar.md#setwindowicon)
* [setWindowOpacity](rnmenubar.md#setwindowopacity)
* [setWindowState](rnmenubar.md#setwindowstate)
* [setWindowTitle](rnmenubar.md#setwindowtitle)
* [show](rnmenubar.md#show)
* [showFullScreen](rnmenubar.md#showfullscreen)
* [showMaximized](rnmenubar.md#showmaximized)
* [showMinimized](rnmenubar.md#showminimized)
* [showNormal](rnmenubar.md#shownormal)
* [size](rnmenubar.md#size)
* [styleSheet](rnmenubar.md#stylesheet)
* [testAttribute](rnmenubar.md#testattribute)
* [update](rnmenubar.md#update)
* [updateGeometry](rnmenubar.md#updategeometry)
* [windowOpacity](rnmenubar.md#windowopacity)
* [windowState](rnmenubar.md#windowstate)
* [windowTitle](rnmenubar.md#windowtitle)

## Constructors

###  constructor

\+ **new RNMenuBar**(): *[RNMenuBar](rnmenubar.md)*

*Inherited from [RNMenuBar](rnmenubar.md).[constructor](rnmenubar.md#constructor)*

*Overrides void*

**Returns:** *[RNMenuBar](rnmenubar.md)*

\+ **new RNMenuBar**(`parent`: NodeWidget‹any›): *[RNMenuBar](rnmenubar.md)*

*Inherited from [RNMenuBar](rnmenubar.md).[constructor](rnmenubar.md#constructor)*

*Overrides void*

**Parameters:**

Name | Type |
------ | ------ |
`parent` | NodeWidget‹any› |

**Returns:** *[RNMenuBar](rnmenubar.md)*

\+ **new RNMenuBar**(`native`: NativeElement): *[RNMenuBar](rnmenubar.md)*

*Inherited from [RNMenuBar](rnmenubar.md).[constructor](rnmenubar.md#constructor)*

*Overrides void*

**Parameters:**

Name | Type |
------ | ------ |
`native` | NativeElement |

**Returns:** *[RNMenuBar](rnmenubar.md)*

## Properties

###  _menus

• **_menus**: *Set‹QMenu›*

*Inherited from [RNMenuBar](rnmenubar.md).[_menus](rnmenubar.md#_menus)*

___

###  _rawInlineStyle

• **_rawInlineStyle**: *string*

*Inherited from void*

___

###  actions

• **actions**: *Set‹QAction›*

*Inherited from void*

___

### `Optional` layout

• **layout**? : *NodeLayout‹QMenuBarSignals›*

*Inherited from void*

___

###  native

• **native**: *NativeElement*

*Inherited from [RNMenuBar](rnmenubar.md).[native](rnmenubar.md#native)*

*Overrides void*

___

###  nodeChildren

• **nodeChildren**: *Set‹Component›*

*Inherited from [RNAction](rnaction.md).[nodeChildren](rnaction.md#nodechildren)*

___

### `Optional` nodeParent

• **nodeParent**? : *Component*

*Inherited from [RNAction](rnaction.md).[nodeParent](rnaction.md#optional-nodeparent)*

___

###  type

• **type**: *string*

*Inherited from void*

___

### `Static` tagName

▪ **tagName**: *string* = "menubar"

## Methods

###  acceptDrops

▸ **acceptDrops**(): *boolean*

*Inherited from void*

**Returns:** *boolean*

___

###  activateWindow

▸ **activateWindow**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  addAction

▸ **addAction**(`action`: QAction | string): *QAction*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`action` | QAction &#124; string |

**Returns:** *QAction*

___

###  addEventListener

▸ **addEventListener**‹**SignalType**›(`signalType`: SignalType, `callback`: QMenuBarSignals[SignalType]): *void*

*Inherited from [RNAction](rnaction.md).[addEventListener](rnaction.md#addeventlistener)*

**Type parameters:**

▪ **SignalType**: *keyof QMenuBarSignals*

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | QMenuBarSignals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |

**Returns:** *void*

void

For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```

▸ **addEventListener**(`eventType`: WidgetEventTypes, `callback`: function): *void*

*Inherited from [RNAction](rnaction.md).[addEventListener](rnaction.md#addeventlistener)*

**Parameters:**

▪ **eventType**: *WidgetEventTypes*

▪ **callback**: *function*

For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```

▸ (`event?`: NativeRawPointer‹"QEvent"›): *void*

**Parameters:**

Name | Type |
------ | ------ |
`event?` | NativeRawPointer‹"QEvent"› |

**Returns:** *void*

___

###  addMenu

▸ **addMenu**(`menu`: QMenu | string): *QMenu*

*Inherited from [RNMenuBar](rnmenubar.md).[addMenu](rnmenubar.md#addmenu)*

**Parameters:**

Name | Type |
------ | ------ |
`menu` | QMenu &#124; string |

**Returns:** *QMenu*

___

###  addSeparator

▸ **addSeparator**(): *QAction*

*Inherited from [RNMenuBar](rnmenubar.md).[addSeparator](rnmenubar.md#addseparator)*

**Returns:** *QAction*

___

###  adjustSize

▸ **adjustSize**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  appendChild

▸ **appendChild**(`child`: QMenu): *void*

**Parameters:**

Name | Type |
------ | ------ |
`child` | QMenu |

**Returns:** *void*

___

###  appendInitialChild

▸ **appendInitialChild**(`child`: QMenu): *void*

**Parameters:**

Name | Type |
------ | ------ |
`child` | QMenu |

**Returns:** *void*

___

###  close

▸ **close**(): *boolean*

*Inherited from void*

**Returns:** *boolean*

___

###  font

▸ **font**(): *QFont*

*Inherited from void*

**Returns:** *QFont*

___

###  geometry

▸ **geometry**(): *QRect*

*Inherited from void*

**Returns:** *QRect*

___

###  getFlexNode

▸ **getFlexNode**(): *FlexNode*

*Inherited from void*

**Returns:** *FlexNode*

___

###  hasMouseTracking

▸ **hasMouseTracking**(): *boolean*

*Inherited from void*

**Returns:** *boolean*

___

###  hide

▸ **hide**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  inherits

▸ **inherits**(`className`: string): *boolean*

*Inherited from [RNAction](rnaction.md).[inherits](rnaction.md#inherits)*

**Parameters:**

Name | Type |
------ | ------ |
`className` | string |

**Returns:** *boolean*

___

###  insertBefore

▸ **insertBefore**(`child`: NodeWidget‹any›, `beforeChild`: NodeWidget‹any›): *void*

**Parameters:**

Name | Type |
------ | ------ |
`child` | NodeWidget‹any› |
`beforeChild` | NodeWidget‹any› |

**Returns:** *void*

___

###  isEnabled

▸ **isEnabled**(): *boolean*

*Inherited from void*

**Returns:** *boolean*

___

###  isVisible

▸ **isVisible**(): *boolean*

*Inherited from void*

**Returns:** *boolean*

___

###  lower

▸ **lower**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  mapFromGlobal

▸ **mapFromGlobal**(`pos`: QPoint): *QPoint*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`pos` | QPoint |

**Returns:** *QPoint*

___

###  mapFromParent

▸ **mapFromParent**(`pos`: QPoint): *QPoint*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`pos` | QPoint |

**Returns:** *QPoint*

___

###  mapToGlobal

▸ **mapToGlobal**(`pos`: QPoint): *QPoint*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`pos` | QPoint |

**Returns:** *QPoint*

___

###  mapToParent

▸ **mapToParent**(`pos`: QPoint): *QPoint*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`pos` | QPoint |

**Returns:** *QPoint*

___

###  maximumSize

▸ **maximumSize**(): *QSize*

*Inherited from void*

**Returns:** *QSize*

___

###  minimumSize

▸ **minimumSize**(): *QSize*

*Inherited from void*

**Returns:** *QSize*

___

###  move

▸ **move**(`x`: number, `y`: number): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`x` | number |
`y` | number |

**Returns:** *void*

___

###  objectName

▸ **objectName**(): *string*

*Inherited from [RNAction](rnaction.md).[objectName](rnaction.md#objectname)*

**Returns:** *string*

___

###  pos

▸ **pos**(): *object*

*Inherited from void*

**Returns:** *object*

* **x**: *number*

* **y**: *number*

___

###  property

▸ **property**(`name`: string): *QVariant*

*Inherited from [RNAction](rnaction.md).[property](rnaction.md#property)*

**Parameters:**

Name | Type |
------ | ------ |
`name` | string |

**Returns:** *QVariant*

___

###  raise

▸ **raise**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  removeAction

▸ **removeAction**(`action`: QAction): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`action` | QAction |

**Returns:** *void*

___

###  removeChild

▸ **removeChild**(`child`: NodeWidget‹any›): *void*

**Parameters:**

Name | Type |
------ | ------ |
`child` | NodeWidget‹any› |

**Returns:** *void*

___

###  removeEventListener

▸ **removeEventListener**‹**SignalType**›(`signalType`: SignalType, `callback`: QMenuBarSignals[SignalType]): *void*

*Inherited from [RNAction](rnaction.md).[removeEventListener](rnaction.md#removeeventlistener)*

**Type parameters:**

▪ **SignalType**: *keyof QMenuBarSignals*

**Parameters:**

Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | QMenuBarSignals[SignalType] |

**Returns:** *void*

▸ **removeEventListener**(`eventType`: WidgetEventTypes, `callback`: function): *void*

*Inherited from [RNAction](rnaction.md).[removeEventListener](rnaction.md#removeeventlistener)*

**Parameters:**

▪ **eventType**: *WidgetEventTypes*

▪ **callback**: *function*

▸ (`event?`: NativeRawPointer‹"QEvent"›): *void*

**Parameters:**

Name | Type |
------ | ------ |
`event?` | NativeRawPointer‹"QEvent"› |

**Returns:** *void*

___

###  repaint

▸ **repaint**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  repolish

▸ **repolish**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  resize

▸ **resize**(`width`: number, `height`: number): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`width` | number |
`height` | number |

**Returns:** *void*

___

###  setAcceptDrops

▸ **setAcceptDrops**(`on`: boolean): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`on` | boolean |

**Returns:** *void*

___

###  setAttribute

▸ **setAttribute**(`attribute`: WidgetAttribute, `switchOn`: boolean): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`attribute` | WidgetAttribute |
`switchOn` | boolean |

**Returns:** *void*

___

###  setContextMenuPolicy

▸ **setContextMenuPolicy**(`contextMenuPolicy`: ContextMenuPolicy): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`contextMenuPolicy` | ContextMenuPolicy |

**Returns:** *void*

___

###  setCursor

▸ **setCursor**(`cursor`: CursorShape | QCursor): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`cursor` | CursorShape &#124; QCursor |

**Returns:** *void*

___

###  setEnabled

▸ **setEnabled**(`enabled`: boolean): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`enabled` | boolean |

**Returns:** *void*

___

###  setFixedSize

▸ **setFixedSize**(`width`: number, `height`: number): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`width` | number |
`height` | number |

**Returns:** *void*

___

###  setFlexNodeSizeControlled

▸ **setFlexNodeSizeControlled**(`isSizeControlled`: boolean): *void*

*Inherited from void*

sets whether the widget's size is controlled by someone else (for example a window's size is controlled by its frame when dragged).

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`isSizeControlled` | boolean |   |

**Returns:** *void*

___

###  setFocus

▸ **setFocus**(`reason`: FocusReason): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`reason` | FocusReason |

**Returns:** *void*

___

###  setFont

▸ **setFont**(`font`: QFont): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`font` | QFont |

**Returns:** *void*

___

###  setGeometry

▸ **setGeometry**(`x`: number, `y`: number, `w`: number, `h`: number): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`x` | number |
`y` | number |
`w` | number |
`h` | number |

**Returns:** *void*

___

###  setGraphicsEffect

▸ **setGraphicsEffect**(`effect`: QGraphicsEffect‹any›): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`effect` | QGraphicsEffect‹any› |

**Returns:** *void*

___

###  setInlineStyle

▸ **setInlineStyle**(`style`: string): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`style` | string |

**Returns:** *void*

___

###  setLayout

▸ **setLayout**(`parentLayout`: NodeLayout‹QMenuBarSignals›): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`parentLayout` | NodeLayout‹QMenuBarSignals› |

**Returns:** *void*

___

###  setMaximumSize

▸ **setMaximumSize**(`maxw`: number, `maxh`: number): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`maxw` | number |
`maxh` | number |

**Returns:** *void*

___

###  setMinimumSize

▸ **setMinimumSize**(`minw`: number, `minh`: number): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`minw` | number |
`minh` | number |

**Returns:** *void*

___

###  setMouseTracking

▸ **setMouseTracking**(`isMouseTracked`: boolean): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`isMouseTracked` | boolean |

**Returns:** *void*

___

###  setNativeMenuBar

▸ **setNativeMenuBar**(`nativeMenuBar`: boolean): *void*

*Inherited from [RNMenuBar](rnmenubar.md).[setNativeMenuBar](rnmenubar.md#setnativemenubar)*

**Parameters:**

Name | Type |
------ | ------ |
`nativeMenuBar` | boolean |

**Returns:** *void*

___

###  setNodeParent

▸ **setNodeParent**(`parent?`: Component): *void*

*Inherited from [RNAction](rnaction.md).[setNodeParent](rnaction.md#setnodeparent)*

**Parameters:**

Name | Type |
------ | ------ |
`parent?` | Component |

**Returns:** *void*

___

###  setObjectName

▸ **setObjectName**(`objectName`: string): *void*

*Inherited from void*

*Overrides [RNAction](rnaction.md).[setObjectName](rnaction.md#setobjectname)*

**Parameters:**

Name | Type |
------ | ------ |
`objectName` | string |

**Returns:** *void*

___

###  setProperty

▸ **setProperty**(`name`: string, `value`: QVariantType): *boolean*

*Inherited from [RNAction](rnaction.md).[setProperty](rnaction.md#setproperty)*

**Parameters:**

Name | Type |
------ | ------ |
`name` | string |
`value` | QVariantType |

**Returns:** *boolean*

___

###  setProps

▸ **setProps**(`newProps`: [MenuBarProps](../interfaces/menubarprops.md), `oldProps`: [MenuBarProps](../interfaces/menubarprops.md)): *void*

**Parameters:**

Name | Type |
------ | ------ |
`newProps` | [MenuBarProps](../interfaces/menubarprops.md) |
`oldProps` | [MenuBarProps](../interfaces/menubarprops.md) |

**Returns:** *void*

___

###  setStyleSheet

▸ **setStyleSheet**(`styleSheet`: string): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`styleSheet` | string |

**Returns:** *void*

___

###  setWindowFlag

▸ **setWindowFlag**(`windowType`: WindowType, `switchOn`: boolean): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`windowType` | WindowType |
`switchOn` | boolean |

**Returns:** *void*

___

###  setWindowIcon

▸ **setWindowIcon**(`icon`: QIcon): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`icon` | QIcon |

**Returns:** *void*

___

###  setWindowOpacity

▸ **setWindowOpacity**(`opacity`: number): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`opacity` | number |

**Returns:** *void*

___

###  setWindowState

▸ **setWindowState**(`state`: WindowState): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`state` | WindowState |

**Returns:** *void*

___

###  setWindowTitle

▸ **setWindowTitle**(`title`: string): *void*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`title` | string |

**Returns:** *void*

___

###  show

▸ **show**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  showFullScreen

▸ **showFullScreen**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  showMaximized

▸ **showMaximized**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  showMinimized

▸ **showMinimized**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  showNormal

▸ **showNormal**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  size

▸ **size**(): *QSize*

*Inherited from void*

**Returns:** *QSize*

___

###  styleSheet

▸ **styleSheet**(): *string*

*Inherited from void*

**Returns:** *string*

___

###  testAttribute

▸ **testAttribute**(`attribute`: WidgetAttribute): *boolean*

*Inherited from void*

**Parameters:**

Name | Type |
------ | ------ |
`attribute` | WidgetAttribute |

**Returns:** *boolean*

___

###  update

▸ **update**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  updateGeometry

▸ **updateGeometry**(): *void*

*Inherited from void*

**Returns:** *void*

___

###  windowOpacity

▸ **windowOpacity**(): *number*

*Inherited from void*

**Returns:** *number*

___

###  windowState

▸ **windowState**(): *number*

*Inherited from void*

**Returns:** *number*

___

###  windowTitle

▸ **windowTitle**(): *string*

*Inherited from void*

**Returns:** *string*
