Skip to content

Add NSStatusBar and NSStatusItem, shown in the desktop's menu bar - #458

Merged
colemancda merged 9 commits into
masterfrom
feature/appkit-status-bar
Nov 25, 2026
Merged

colemancda merged 9 commits into
masterfrom
feature/appkit-status-bar

Conversation

@colemancda

Copy link
Copy Markdown
Member

AppKit now has NSStatusBar, NSStatusItem and NSStatusBarButton. A Mac app's status items show at the right of the desktop's menu bar, through PerryDesktopStatusItems:

  • NSStatusBar: +systemStatusBar, -statusItemWithLength:, -removeStatusItem:, -thickness.
  • NSStatusItem: button, menu, length, visible, behavior, autosaveName. The pre-10.10 title, image, toolTip, target and action go through the button.
  • The button: its title and tool tip are what the bar shows. Changing them updates the bar.
  • The menu: an item with a menu opens it when clicked. The menu's delegate fills it and its items are validated before it opens, and choosing an item sends its action, as on a Mac.
  • No menu: a click sends the button's action.
  • Hiding: an item that isn't visible is passive, which the bar hides.
  • Not shown yet: images. An item with no title shows the app's name. A custom view isn't shown either.

PERRY_APPKIT_STATUS_ITEMS=0 shows none.

Merge after #457, which this branch stacks on.

Testing

In the Debian VM, a small arm64 AppKit app ran on Perry under CacaoWindowServer, with swift-linux-shell's menu bar. It made two status items:

  • "Notes", with a menu: clicking it opened New Note ⌘N, a separator and Quit Notepad ⌘Q. Choosing New Note sent its action to the app.
  • "Ping", with only an action: clicking it sent the action, and the app's change of the button's title to "Pinged" showed in the bar.

@colemancda
colemancda merged commit e30e794 into master Nov 25, 2026
2 of 6 checks passed
@colemancda
colemancda deleted the feature/appkit-status-bar branch November 25, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant