Goo.NativeMenus 0.13.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Goo.NativeMenus --version 0.13.0
                    
NuGet\Install-Package Goo.NativeMenus -Version 0.13.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Goo.NativeMenus" Version="0.13.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Goo.NativeMenus" Version="0.13.0" />
                    
Directory.Packages.props
<PackageReference Include="Goo.NativeMenus" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Goo.NativeMenus --version 0.13.0
                    
#r "nuget: Goo.NativeMenus, 0.13.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Goo.NativeMenus@0.13.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Goo.NativeMenus&version=0.13.0
                    
Install as a Cake Addin
#tool nuget:?package=Goo.NativeMenus&version=0.13.0
                    
Install as a Cake Tool

Native menus

let save = Command(() -> SaveDocument())
let actions = List[NativeMenuItem]()
actions.Add(NativeMenuItem{
    Id: "save", Text: "Save", Enabled: save.CanExecute,
    Shortcut: NativeMenuShortcut{Key: "s", Modifiers: KeyModifiers{Super: true}},
})
let menus = List[NativeMenuItem]()
menus.Add(NativeMenuItem{Id: "file", Text: "File", Items: actions})
let bar = NativeMenuBar(window)
bar.Activated += id -> { if id == "save" { save.Execute() } }
let result = bar.SetItems(menus)

Reference Goo.NativeMenus. Share Command objects with widgets.

  • Call on the open owner's UI thread. Dispose the bar when it is no longer needed.
  • Publish a complete snapshot. IDs and shortcuts must be unique.
  • A separator has an empty ID, no children and no shortcut.
  • A shortcut uses one printable logical key. It runs as a native accelerator.
  • Bar activation uses the Goo queue after input is restored. Context selection completes only its task.
  • Context points use owner-content Goo layout units.
  • Desktop tracking blocks the Goo scheduler.
  • Check the result status. Cancellation is Cancelled. Conflicting work in an owner chain is Busy.
  • Closing the owner completes a pending menu as OwnerClosed, including before native launch.
Platform Bar Context
macOS Global bar selected by the key Goo window NSMenu
Windows Per-window HMENU TrackPopupMenuEx
Wayland Unsupported Unsupported
Android Unsupported Android ContextMenu

macOS keeps SDL's application and system menus. Super means Command. The default bar is restored only while this package still owns the menu. Windows uses the active keyboard layout and rebuilds accelerators when it changes. Super and keys outside that layout return Unsupported. The official SDL binary supplies the pre-TranslateMessage hook. No SDL patch is required.

Android requires GooActivity, which forwards native menu closure to the owner. Other Activity hosts return Unsupported. Android shortcuts return Unsupported. Activity teardown completes the menu as OwnerClosed. Build both package targets with -p:GooBuildAndroid=true.

dotnet build tests/Goo.AndroidSmoke/Goo.AndroidSmoke.csproj -c Release -p:GooBuildAndroid=true
adb shell am start -n org.goo.androidsmoke/.MainActivity --ez goo.native_menu_smoke true
adb logcat -s GooNativeMenus

On a Vulkan Android device, open Actions, then choose Select. Press Back on the cancellation menu. The smoke then checks owner-close completion and prints passed.

See API reference.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • Goo (>= 0.13.0)
  • net10.0-android36.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.15.0 112 10/24/2026
0.13.0 105 10/24/2026
0.12.1 112 10/24/2026
0.12.0 101 10/23/2026
0.11.0 101 10/23/2026
0.10.0 110 10/23/2026
0.9.0 103 10/23/2026