Skip to content

Host

The NSHostingView-backed leaf that mounts one SwiftUI component tree inside QuickGUI.

#Import

Import ui from github.com/egoist/quickgui/go/ui.

import (
	"github.com/egoist/quickgui/go/ui"
)

#Usage

func SwiftUiHostExample() *native.Node {
	return ui.SwiftUI.Host(
		ui.SwiftUIHostProps{MatchContents: true},
		func() *native.Node {
			return ui.SwiftUI.Button(ui.SwiftUIButtonProps{Label: "Continue"})
		},
	)
}

#API reference

Expand an entry for its description and complete signature. A dash means no declaration default is documented.

SwiftUI.Host

View source
ui.SwiftUI.Host(props SwiftUIHostProps, children ...any) *native.Node

Host is a native NSHostingView laid out as one QuickGUI leaf.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
View source
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
View source
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
View source
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
View source
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
View source
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
View source
Groupany—

Names this element as a group for descendant interaction-state styling.

any
View source
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
View source
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
View source
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
View source
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
View source
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
View source
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
View source
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
View source
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
View source
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
View source
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
View source
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
View source
MatchContentsany—

Uses the hosted subtree’s intrinsic width, height, or both.

any
View source