Skip to content
Platforms

Platforms

The same Bellui code runs on macOS, Windows, Linux and BSD, Android, iOS and in web browsers. Most of an app never needs to know which. These pages cover the parts that differ: features only one kind of platform has, and how building and running work there.

Finding out where you are

bellui.CurrentDevice() describes the device the app runs on. IsMobile() reports a phone or tablet, and IsBrowser() reports a web page. Prefer these to checking runtime.GOOS: they are also correct in the mobile simulation described on the Mobile page.

Platform-specific features are offered as optional interfaces. You check for them with a type assertion and skip the feature when it is missing:

FeatureAssertAvailable on
System trayapp.Driver().(desktop.App)Desktop
Global shortcutsapp.Driver().(desktop.GlobalShortcutApp)Desktop
Raw key down and up eventswindow.Canvas().(desktop.Canvas)Desktop, web
Window positionwindow.(desktop.PositionableWindow)Desktop
Badge count on the app iconapp.(bellui.BadgeApp)Desktop, iOS
Start at loginapp.(bellui.LaunchAtLoginApp)Desktop
Single running instanceapp.(bellui.SingleInstanceApp)Desktop (a no-op elsewhere)
Virtual keyboard controlbellui.CurrentDevice().(mobile.Device)Mobile