Create and manage menubar icons
| Signature | hs.menubar.imagePositions[] |
|---|---|
| Type | Constant |
| Description | Pre-defined list of image positions for a menubar item |
| Source | extensions/menubar/libmenubar.m line 1131 |
| Signature | hs.menubar.new([inMenuBar], [autosaveName]) -> menubaritem or nil |
|---|---|
| Type | Constructor |
| Description | Creates a new menu bar item object and optionally add it to the system menubar |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/menubar/libmenubar.m line 411 |
| Signature | hs.menubar:autosaveName([name]) -> menubaritem | current-value |
|---|---|
| Type | Method |
| Description | Get or set the autosave name of the menubar. By defining an autosave name, macOS can restore the menubar position after reloads. |
| Parameters |
|
| Returns |
|
| Source | extensions/menubar/libmenubar.m line 482 |
| Signature | hs.menubar:delete() |
|---|---|
| Type | Method |
| Description | Removes the menubar item from the menubar and destroys it |
| Parameters |
|
| Returns |
|
| Source | extensions/menubar/libmenubar.m line 819 |
| Signature | hs.menubar:frame() -> hs.geometry rect |
|---|---|
| Type | Method |
| Description | Returns the menubar item frame |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/menubar/menubar.lua line 36 |
| Signature | hs.menubar:icon() -> hs.image object |
|---|---|
| Type | Method |
| Description | Returns the current icon of the menubar item object. |
| Parameters |
|
| Returns |
|
| Source | extensions/menubar/libmenubar.m line 1054 |
| Signature | hs.menubar:imagePosition([position]) -> menubaritem | current-value |
|---|---|
| Type | Method |
| Description | Get or set the position of a menubar image relative to its text title |
| Parameters |
|
| Returns |
|
| Source | extensions/menubar/libmenubar.m line 522 |
| Signature | hs.menubar:isInMenuBar() -> boolean |
|---|---|
| Type | Method |
| Description | Returns a boolean indicating whether or not the specified menu is currently in the OS X menubar. |
| Parameters |
|
| Returns |
|
| Source | extensions/menubar/libmenubar.m line 1017 |
| Signature | hs.menubar:popupMenu(point[, darkMode]) -> menubaritem |
|---|---|
| Type | Method |
| Description | Display a menubaritem as a pop up menu at the specified screen point. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/menubar/libmenubar.m line 869 |
| Signature | hs.menubar:removeFromMenuBar() -> menubaritem |
|---|---|
| Type | Method |
| Description | Removes a menu from the system menu bar. The item can still be used as a pop-up menu, unless you also delete it. |
| Parameters |
|
| Returns |
|
| Source | extensions/menubar/libmenubar.m line 952 |
| Signature | hs.menubar:returnToMenuBar() -> menubaritem |
|---|---|
| Type | Method |
| Description | Returns a previously removed menu back to the system menu bar. |
| Parameters |
|
| Returns |
|
| Source | extensions/menubar/libmenubar.m line 985 |
| Signature | hs.menubar:setClickCallback([fn]) -> menubaritem |
|---|---|
| Type | Method |
| Description | Registers a function to be called when the menubar item is clicked |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/menubar/libmenubar.m line 670 |
| Signature | hs.menubar:setIcon(imageData[, template]) -> menubaritem or nil |
|---|---|
| Type | Method |
| Description | Sets the image of a menubar item object. The image will be displayed in the system menubar |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/menubar/libmenubar.m line 589 |
| Signature | hs.menubar:setMenu(menuTable) -> menubaritem |
|---|---|
| Type | Method |
| Description | Attaches a dropdown menu to the menubar item |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/menubar/libmenubar.m line 719 |
| Signature | hs.menubar:setTitle(title) -> menubaritem |
|---|---|
| Type | Method |
| Description | Sets the title of a menubar item object. The title will be displayed in the system menubar |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/menubar/libmenubar.m line 550 |
| Signature | hs.menubar:setTooltip(tooltip) -> menubaritem |
|---|---|
| Type | Method |
| Description | Sets the tooltip text on a menubar item |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/menubar/libmenubar.m line 646 |
| Signature | hs.menubar:stateImageSize([size]) -> hs.image object | current value |
|---|---|
| Type | Method |
| Description | Get or set the size for state images when the menu is displayed. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/menubar/libmenubar.m line 1091 |
| Signature | hs.menubar:title([styled]) -> string | styledtextObject |
|---|---|
| Type | Method |
| Description | Returns the current title of the menubar item object. |
| Parameters |
|
| Returns |
|
| Source | extensions/menubar/libmenubar.m line 1032 |