cocoa

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	NSApplicationActivationPolicyRegular    = 0
	NSApplicationActivationPolicyAccessory  = 1
	NSApplicationActivationPolicyProhibited = 2
)
View Source
const (
	NSControlStateValueMixed = -1
	NSControlStateValueOff   = 0
	NSControlStateValueOn    = 1

	NSNoImage       = 0
	NSImageOnly     = 1
	NSImageLeft     = 2
	NSImageRight    = 3
	NSImageBelow    = 4
	NSImageAbove    = 5
	NSImageOverlaps = 6
)
View Source
const (
	NSEventTypeLeftMouseDown      = 1
	NSEventTypeLeftMouseUp        = 2
	NSEventTypeRightMouseDown     = 3
	NSEventTypeRightMouseUp       = 4
	NSEventTypeMouseMoved         = 5
	NSEventTypeLeftMouseDragged   = 6
	NSEventTypeRightMouseDragged  = 7
	NSEventTypeMouseEntered       = 8
	NSEventTypeMouseExited        = 9
	NSEventTypeKeyDown            = 10
	NSEventTypeKeyUp              = 11
	NSEventTypeFlagsChanged       = 12
	NSEventTypeAppKitDefined      = 13
	NSEventTypeSystemDefined      = 14
	NSEventTypeApplicationDefined = 15
	NSEventTypePeriodic           = 16
	NSEventTypeCursorUpdate       = 17
	NSEventTypeRotate             = 18
	NSEventTypeBeginGesture       = 19
	NSEventTypeEndGesture         = 20
	NSEventTypeScrollWheel        = 22
	NSEventTypeTabletPoint        = 23
	NSEventTypeTabletProximity    = 24
	NSEventTypeOtherMouseDown     = 25
	NSEventTypeOtherMouseUp       = 26
	NSEventTypeOtherMouseDragged  = 27
	NSEventTypeGesture            = 29
	NSEventTypeMagnify            = 30
	NSEventTypeSwipe              = 31
	NSEventTypeSmartMagnify       = 32
	NSEventTypeQuickLook          = 33
	NSEventTypePressure           = 34
	NSEventTypeDirectTouch        = 37
	NSEventTypeChangeMode         = 38

	NSEventMaskLeftMouseDown      uint64 = 1 << NSEventTypeLeftMouseDown
	NSEventMaskLeftMouseUp        uint64 = 1 << NSEventTypeLeftMouseUp
	NSEventMaskRightMouseDown     uint64 = 1 << NSEventTypeRightMouseDown
	NSEventMaskRightMouseUp       uint64 = 1 << NSEventTypeRightMouseUp
	NSEventMaskMouseMoved         uint64 = 1 << NSEventTypeMouseMoved
	NSEventMaskLeftMouseDragged   uint64 = 1 << NSEventTypeLeftMouseDragged
	NSEventMaskRightMouseDragged  uint64 = 1 << NSEventTypeRightMouseDragged
	NSEventMaskMouseEntered       uint64 = 1 << NSEventTypeMouseEntered
	NSEventMaskMouseExited        uint64 = 1 << NSEventTypeMouseExited
	NSEventMaskKeyDown            uint64 = 1 << NSEventTypeKeyDown
	NSEventMaskKeyUp              uint64 = 1 << NSEventTypeKeyUp
	NSEventMaskFlagsChanged       uint64 = 1 << NSEventTypeFlagsChanged
	NSEventMaskAppKitDefined      uint64 = 1 << NSEventTypeAppKitDefined
	NSEventMaskSystemDefined      uint64 = 1 << NSEventTypeSystemDefined
	NSEventMaskApplicationDefined uint64 = 1 << NSEventTypeApplicationDefined
	NSEventMaskPeriodic           uint64 = 1 << NSEventTypePeriodic
	NSEventMaskCursorUpdate       uint64 = 1 << NSEventTypeCursorUpdate
	NSEventMaskRotate             uint64 = 1 << NSEventTypeRotate
	NSEventMaskBeginGesture       uint64 = 1 << NSEventTypeBeginGesture
	NSEventMaskEndGesture         uint64 = 1 << NSEventTypeEndGesture
	NSEventMaskScrollWheel        uint64 = 1 << NSEventTypeScrollWheel
	NSEventMaskTabletPoint        uint64 = 1 << NSEventTypeTabletPoint
	NSEventMaskTabletProximity    uint64 = 1 << NSEventTypeTabletProximity
	NSEventMaskOtherMouseDown     uint64 = 1 << NSEventTypeOtherMouseDown
	NSEventMaskOtherMouseUp       uint64 = 1 << NSEventTypeOtherMouseUp
	NSEventMaskOtherMouseDragged  uint64 = 1 << NSEventTypeOtherMouseDragged
	NSEventMaskGesture            uint64 = 1 << NSEventTypeGesture
	NSEventMaskMagnify            uint64 = 1 << NSEventTypeMagnify
	NSEventMaskSwipe              uint64 = 1 << NSEventTypeSwipe
	NSEventMaskSmartMagnify       uint64 = 1 << NSEventTypeSmartMagnify
	NSEventMaskQuickLook          uint64 = 1 << NSEventTypeQuickLook
	NSEventMaskPressure           uint64 = 1 << NSEventTypePressure
	NSEventMaskDirectTouch        uint64 = 1 << NSEventTypeDirectTouch
	NSEventMaskChangeMode         uint64 = 1 << NSEventTypeChangeMode

	NSEventMaskAny uint64 = 18446744073709551615
)
View Source
const (
	// NSPasteboardTypeURL holds URL data for one file or resource.
	NSPasteboardTypeURL = NSPasteboardType("public.url")
	// NSPasteboardTypeColor holds color data.
	NSPasteboardTypeColor = NSPasteboardType("com.apple.cocoa.pasteboard.color")
	// NSPasteboardTypeFileURL holds a file URL.
	NSPasteboardTypeFileURL = NSPasteboardType("public.file-url")
	// NSPasteboardTypeFont holds font and character information.
	NSPasteboardTypeFont = NSPasteboardType("com.apple.cocoa.pasteboard.character-formatting")
	// NSPasteboardTypeHTML holds type for HTML content.
	NSPasteboardTypeHTML = NSPasteboardType("public.html")
	// NSPasteboardTypeMultipleTextSelection holds multiple text selection.
	NSPasteboardTypeMultipleTextSelection = NSPasteboardType("com.apple.cocoa.pasteboard.multiple-text-selection")
	// NSPasteboardTypePDF holds PDF data.
	NSPasteboardTypePDF = NSPasteboardType("com.adobe.pdf")
	// NSPasteboardTypePNG holds PNG image data.
	NSPasteboardTypePNG = NSPasteboardType("public.png")
	// NSPasteboardTypeRTF holds rich Text Format (RTF) data.
	NSPasteboardTypeRTF = NSPasteboardType("public.rtf")
	// NSPasteboardTypeRTFD holds RTFD formatted file contents.
	NSPasteboardTypeRTFD = NSPasteboardType("com.apple.flat-rtfd")
	// NSPasteboardTypeRuler holds paragraph formatting information.
	NSPasteboardTypeRuler = NSPasteboardType("com.apple.cocoa.pasteboard.paragraph-formatting")
	// NSPasteboardTypeSound holds sound data.
	NSPasteboardTypeSound = NSPasteboardType("com.apple.cocoa.pasteboard.sound")
	// NSPasteboardTypeString holds string data.
	NSPasteboardTypeString = NSPasteboardType("public.utf8-plain-text")
	// NSPasteboardTypeTabularText holds tab-separated fields of text.
	NSPasteboardTypeTabularText = NSPasteboardType("public.utf8-tab-separated-values-text")
	// NSPasteboardTypeTextFinderOptions holds type for the Find panel metadata property list.
	NSPasteboardTypeTextFinderOptions = NSPasteboardType("com.apple.cocoa.pasteboard.find-panel-search-options")
	// NSPasteboardTypeTIFF holds tag Image File Format (TIFF) data.
	NSPasteboardTypeTIFF = NSPasteboardType("public.tiff")
)
View Source
const (
	NSVariableStatusItemLength = -1.0
	NSSquareStatusItemLength   = -2.0
)
View Source
const (
	NSVisualEffectBlendingModeBehindWindow = 0
	NSVisualEffectBlendingModeWithinWindow = 1
)
View Source
const (
	NSBorderlessWindowMask          = 0
	NSTitledWindowMask              = 1 << 0
	NSClosableWindowMask            = 1 << 1
	NSMiniaturizableWindowMask      = 1 << 2
	NSResizableWindowMask           = 1 << 3
	NSTexturedBackgroundWindowMask  = 1 << 8
	NSWindowStyleMaskFullScreen     = 1 << 14
	NSFullSizeContentViewWindowMask = 32768

	NSWindowTitleVisible = 0
	NSWindowTitleHidden  = 1

	NSWindowAbove = 1
	NSWindowBelow = -1
	NSWindowOut   = 0

	NSBackingStoreRetained    NSBackingStoreType = 0
	NSBackingStoreNonretained NSBackingStoreType = 1
	NSBackingStoreBuffered    NSBackingStoreType = 2

	NSFloatingWindowLevel = 3
	NSMainMenuWindowLevel = 24

	NSWindowCollectionBehaviorDefault                   = 0
	NSWindowCollectionBehaviorCanJoinAllSpaces          = 1 << 0
	NSWindowCollectionBehaviorMoveToActiveSpace         = 1 << 1
	NSWindowCollectionBehaviorManaged                   = 1 << 2
	NSWindowCollectionBehaviorTransient                 = 1 << 3
	NSWindowCollectionBehaviorStationary                = 1 << 4
	NSWindowCollectionBehaviorParticipatesInCycle       = 1 << 5
	NSWindowCollectionBehaviorIgnoresCycle              = 1 << 6
	NSWindowCollectionBehaviorFullScreenPrimary         = 1 << 7
	NSWindowCollectionBehaviorFullScreenAuxiliary       = 1 << 8
	NSWindowCollectionBehaviorFullScreenNone            = 1 << 9
	NSWindowCollectionBehaviorFullScreenAllowsTiling    = 1 << 11
	NSWindowCollectionBehaviorFullScreenDisallowsTiling = 1 << 12
)

Variables

View Source
var (
	DefaultDelegate      objc.Object
	DefaultDelegateClass objc.Class

	TerminateAfterWindowsClose = true
)

Functions

func NSEvent_GlobalMonitorMatchingMask

func NSEvent_GlobalMonitorMatchingMask(mask uint64, ch chan NSEvent)

Types

type NSApplication

type NSApplication struct {
	objc.Object
}

func NSApp

func NSApp() NSApplication

func NSApp_WithDidLaunch

func NSApp_WithDidLaunch(cb func(notification objc.Object)) NSApplication

func NSApplication_New

func NSApplication_New() NSApplication

func (NSApplication) ActivateIgnoringOtherApps

func (app NSApplication) ActivateIgnoringOtherApps(flag bool)

func (NSApplication) Delegate

func (app NSApplication) Delegate() objc.Object

func (NSApplication) MainMenu

func (app NSApplication) MainMenu() NSMenu

func (NSApplication) Run

func (app NSApplication) Run()

func (NSApplication) SetActivationPolicy

func (app NSApplication) SetActivationPolicy(policy int)

func (NSApplication) SetDelegate

func (app NSApplication) SetDelegate(delegate objc.Object)

func (NSApplication) SetMainMenu

func (app NSApplication) SetMainMenu(menu NSMenu)

func (NSApplication) Terminate

func (app NSApplication) Terminate()

type NSBackingStoreType

type NSBackingStoreType uintptr

type NSBundle

type NSBundle struct {
	objc.Object
}

func NSBundle_Main

func NSBundle_Main() NSBundle

func (NSBundle) InfoDictionary

func (bundle NSBundle) InfoDictionary() core.NSDictionary

type NSColor

type NSColor struct {
	objc.Object
}

func Color

func Color(r, g, b, a float64) NSColor

func NSColor_Clear

func NSColor_Clear() NSColor

func NSColor_Init

func NSColor_Init(r, g, b, a float64) NSColor

type NSEvent

type NSEvent struct {
	objc.Object
}

func (NSEvent) Characters added in v0.0.2

func (e NSEvent) Characters() (string, error)

func (NSEvent) KeyCode

func (e NSEvent) KeyCode() (int64, error)

func (NSEvent) Type added in v0.0.2

func (e NSEvent) Type() int64

type NSFont

type NSFont struct {
	objc.Object
}

func Font

func Font(fontName string, size float64) NSFont

func NSFont_Init

func NSFont_Init(fontName string, size float64) NSFont

type NSImage

type NSImage struct {
	objc.Object
}

func NSImage_ImageNamed

func NSImage_ImageNamed(name string) NSImage

func NSImage_InitWithData

func NSImage_InitWithData(data core.NSData) NSImage

func (NSImage) IsTemplate

func (i NSImage) IsTemplate() bool

func (NSImage) SetSize

func (i NSImage) SetSize(size core.NSSize)

func (NSImage) SetTemplate

func (i NSImage) SetTemplate(b bool)

func (NSImage) SetValueForKey

func (i NSImage) SetValueForKey(value, key interface{})

func (NSImage) Size

func (i NSImage) Size() (size core.NSSize)

broken

type NSImageView

type NSImageView struct {
	objc.Object
}

func NSImageView_New

func NSImageView_New() NSImageView

func (NSImageView) Image

func (imgView NSImageView) Image() NSImage

func (NSImageView) SetImage

func (imgView NSImageView) SetImage(img objc.Object)

type NSLayoutManager

type NSLayoutManager struct {
	objc.Object
}

func (NSLayoutManager) EnsureLayoutForTextContainer

func (lm NSLayoutManager) EnsureLayoutForTextContainer(tc NSTextContainer)

func (NSLayoutManager) UsedRectForTextContainer

func (lm NSLayoutManager) UsedRectForTextContainer(tc NSTextContainer) (rect core.NSRect)

type NSMenu

type NSMenu struct {
	objc.Object
}

func NSMenu_Init

func NSMenu_Init(title string) NSMenu

func NSMenu_New

func NSMenu_New() NSMenu

func (NSMenu) AddItem

func (menu NSMenu) AddItem(item NSMenuItem)

func (NSMenu) AutoenablesItems

func (menu NSMenu) AutoenablesItems() bool

func (NSMenu) RemoveItem

func (menu NSMenu) RemoveItem(item NSMenuItem)

func (NSMenu) SetAutoenablesItems

func (menu NSMenu) SetAutoenablesItems(b bool)

func (NSMenu) SetTitle

func (menu NSMenu) SetTitle(title string)

func (NSMenu) Title

func (menu NSMenu) Title() string

type NSMenuItem

type NSMenuItem struct {
	objc.Object
}

NSMenuItem is a command item in an app menu. https://developer.apple.com/documentation/appkit/nsmenuitem?language=objc

func NSMenuItem_Init

func NSMenuItem_Init(itemName string, action objc.Selector, keyEquivalent string) NSMenuItem

NSMenuItem_Init returns an initialized instance of NSMenuItem. https://developer.apple.com/documentation/appkit/nsmenuitem/1514858-initwithtitle?language=objc

func NSMenuItem_New

func NSMenuItem_New() NSMenuItem

NSMenuItem_New returns an initialized instance of NSMenuItem.

func NSMenuItem_Separator

func NSMenuItem_Separator() NSMenuItem

NSMenuItem_Separator returns a menu item that is used to separate logical groups of menu commands. https://developer.apple.com/documentation/appkit/nsmenuitem/1514838-separatoritem?language=objc

func (NSMenuItem) Action

func (i NSMenuItem) Action() objc.Selector

Action returns the menu item's action-method selector. https://developer.apple.com/documentation/appkit/nsmenuitem/1514825-action?language=objc

func (NSMenuItem) Enabled

func (i NSMenuItem) Enabled() bool

Enabled returns a boolean value that indicates whether the menu item is enabled. https://developer.apple.com/documentation/appkit/nsmenuitem/1514863-enabled?language=objc

func (NSMenuItem) Hidden

func (i NSMenuItem) Hidden() bool

Hidden returns a boolean value that indicates whether the menu item is hidden. https://developer.apple.com/documentation/appkit/nsmenuitem/1514846-hidden?language=objc

func (NSMenuItem) Image

func (i NSMenuItem) Image() NSImage

Image returns the menu item’s image. https://developer.apple.com/documentation/appkit/nsmenuitem/1514819-image?language=objc

func (NSMenuItem) SetAction

func (i NSMenuItem) SetAction(sel objc.Selector)

SetAction sets the menu item's action-method selector. https://developer.apple.com/documentation/appkit/nsmenuitem/1514825-action?language=objc

func (NSMenuItem) SetEnabled

func (i NSMenuItem) SetEnabled(b bool)

SetEnabled sets a boolean value that indicates whether the menu item is enabled. https://developer.apple.com/documentation/appkit/nsmenuitem/1514863-enabled?language=objc

func (NSMenuItem) SetHidden

func (i NSMenuItem) SetHidden(b bool)

SetHidden sets a boolean value that indicates whether the menu item is hidden. https://developer.apple.com/documentation/appkit/nsmenuitem/1514846-hidden?language=objc

func (NSMenuItem) SetImage

func (i NSMenuItem) SetImage(obj NSImage)

SetImage sets the menu item’s image. https://developer.apple.com/documentation/appkit/nsmenuitem/1514819-image?language=objc

func (NSMenuItem) SetState

func (i NSMenuItem) SetState(state int)

SetState sets the state of the menu item. https://developer.apple.com/documentation/appkit/nsmenuitem/1514804-state?language=objc

func (NSMenuItem) SetSubmenu

func (i NSMenuItem) SetSubmenu(submenu NSMenu)

SetSubmenu sets the submenu of the menu item. https://developer.apple.com/documentation/appkit/nsmenuitem/1514845-submenu?language=objc

func (NSMenuItem) SetTarget

func (i NSMenuItem) SetTarget(obj objc.Object)

SetTarget sets the menu item's target. https://developer.apple.com/documentation/appkit/nsmenuitem/1514843-target?language=objc

func (NSMenuItem) SetTitle

func (i NSMenuItem) SetTitle(s string)

SetTitle sets the menu item's title. https://developer.apple.com/documentation/appkit/nsmenuitem/1514805-title?language=objc

func (NSMenuItem) SetToolTip

func (i NSMenuItem) SetToolTip(s string)

SetToolTip sets a help tag for the menu item. https://developer.apple.com/documentation/appkit/nsmenuitem/1514848-tooltip?language=objc

func (NSMenuItem) State

func (i NSMenuItem) State() int64

State returns the state of the menu item. https://developer.apple.com/documentation/appkit/nsmenuitem/1514804-state?language=objc

func (NSMenuItem) Submenu

func (i NSMenuItem) Submenu() NSMenu

Submenu returns the submenu of the menu item. https://developer.apple.com/documentation/appkit/nsmenuitem/1514845-submenu?language=objc

func (NSMenuItem) Target

func (i NSMenuItem) Target() objc.Object

Target returns the menu item's target. https://developer.apple.com/documentation/appkit/nsmenuitem/1514843-target?language=objc

func (NSMenuItem) Title

func (i NSMenuItem) Title() string

Title returns the menu item's title. https://developer.apple.com/documentation/appkit/nsmenuitem/1514805-title?language=objc

func (NSMenuItem) ToolTip

func (i NSMenuItem) ToolTip() string

ToolTip returns a help tag for the menu item. https://developer.apple.com/documentation/appkit/nsmenuitem/1514848-tooltip?language=objc

type NSNib

type NSNib struct {
	objc.Object
}

func NSNib_Init

func NSNib_Init(name string, bundle NSBundle) NSNib

func (NSNib) InstantiateWithOwner

func (nib NSNib) InstantiateWithOwner(owner objc.Object)

type NSPasteboard added in v0.0.2

type NSPasteboard struct {
	objc.Object
}

Wrapper for NSPasteboard https://developer.apple.com/documentation/appkit/nspasteboard?language=objc

Example
package main

import (
	"fmt"
	"github.com/progrium/macdriver/cocoa"
)

func main() {
	// get general pasteboard
	gp := cocoa.NSPasteboard_GeneralPasteboard()

	// clear pasteboard and write to pasteboard
	gp.ClearContents()
	gp.SetStringForType("test-content", cocoa.NSPasteboardTypeString)

	// read data from pasteboard
	fmt.Println(gp.StringForType(cocoa.NSPasteboardTypeString))
}
Output:

test-content

func NSPasteboard_GeneralPasteboard added in v0.0.2

func NSPasteboard_GeneralPasteboard() NSPasteboard

NSPasteboard_GeneralPasteboard is the shared pasteboard object to use for general content. https://developer.apple.com/documentation/appkit/nspasteboard/1530091-generalpasteboard?language=objc

func (NSPasteboard) AvailableTypeFromArray added in v0.0.3

func (pb NSPasteboard) AvailableTypeFromArray(types []NSPasteboardType) NSPasteboardType

AvailableTypeFromArray scans the specified types for a type that the receiver supports. https://developer.apple.com/documentation/appkit/nspasteboard/1526078-availabletypefromarray?language=objc

func (NSPasteboard) ClearContents added in v0.0.2

func (pb NSPasteboard) ClearContents()

ClearContents clears the existing contents of the pasteboard. https://developer.apple.com/documentation/appkit/nspasteboard/1533599-clearcontents?language=objc

func (NSPasteboard) DataForType added in v0.0.3

func (pb NSPasteboard) DataForType(t NSPasteboardType) core.NSData

DataForType returns the data for the specified type from the first item in the receiver that contains the type. https://developer.apple.com/documentation/appkit/nspasteboard/1531810-datafortype?language=objc

Example
package main

import (
	"github.com/progrium/macdriver/cocoa"
	"io/ioutil"
	"log"
)

func main() {
	// get general pasteboard
	gp := cocoa.NSPasteboard_GeneralPasteboard()
	// check which is the best available type (list all the types you can to handle here)
	pbType := gp.AvailableTypeFromArray([]cocoa.NSPasteboardType{cocoa.NSPasteboardTypePNG, cocoa.NSPasteboardTypeTIFF})
	if pbType == "" {
		// check which types are in the pasteboard right now
		log.Printf("no matching type found. only found: %s \n", gp.Types())
		return
	}
	// fetch data
	data := gp.DataForType(pbType)
	var bs []byte
	// turn into go bytes
	bs = data.Bytes()

	f, err := ioutil.TempFile("", "out-img")
	if err != nil {
		log.Fatalln(err)
	}
	_, err = f.Write(bs)
	if err != nil {
		log.Fatalln(err)
	}
	log.Printf("png written to file: %s\n", f.Name())
}

func (NSPasteboard) SetStringForType added in v0.0.2

func (pb NSPasteboard) SetStringForType(s string, t NSPasteboardType)

SetStringForType sets the given string as the representation for the specified type for the first item on the receiver. https://developer.apple.com/documentation/appkit/nspasteboard/1528225-setstring?language=objc

func (NSPasteboard) StringForType added in v0.0.2

func (pb NSPasteboard) StringForType(t NSPasteboardType) string

StringForType returns a concatenation of the strings for the specified type from all the items in the receiver that contain the type. https://developer.apple.com/documentation/appkit/nspasteboard/1533566-stringfortype?language=objc

func (NSPasteboard) Types added in v0.0.3

func (pb NSPasteboard) Types() []NSPasteboardType

Types is an array of the receiver’s supported data types. https://developer.apple.com/documentation/appkit/nspasteboard/1529599-types?language=objc

type NSPasteboardType added in v0.0.2

type NSPasteboardType string

The supported pasteboard types. https://developer.apple.com/documentation/appkit/nspasteboardtype?language=objc

type NSScreen

type NSScreen struct {
	objc.Object
}

func NSScreen_Main

func NSScreen_Main() NSScreen

func NSScreen_Screens added in v0.1.0

func NSScreen_Screens() []NSScreen

func (NSScreen) Frame

func (s NSScreen) Frame() (frame core.NSRect)

type NSStatusBar

type NSStatusBar struct {
	objc.Object
}

func NSStatusBar_System

func NSStatusBar_System() NSStatusBar

func (NSStatusBar) RemoveStatusItem

func (sb NSStatusBar) RemoveStatusItem(i NSStatusItem)

func (NSStatusBar) StatusItemWithLength

func (sb NSStatusBar) StatusItemWithLength(l float64) NSStatusItem

type NSStatusBarButton

type NSStatusBarButton struct {
	NSView
}

func (NSStatusBarButton) Image

func (b NSStatusBarButton) Image() NSImage

func (NSStatusBarButton) ImagePosition

func (b NSStatusBarButton) ImagePosition() int64

func (NSStatusBarButton) SetImage

func (b NSStatusBarButton) SetImage(obj NSImage)

func (NSStatusBarButton) SetImagePosition

func (b NSStatusBarButton) SetImagePosition(state int)

func (NSStatusBarButton) SetTitle

func (b NSStatusBarButton) SetTitle(s string)

func (NSStatusBarButton) SetToolTip

func (b NSStatusBarButton) SetToolTip(s string)

func (NSStatusBarButton) Title

func (b NSStatusBarButton) Title() string

func (NSStatusBarButton) ToolTip

func (b NSStatusBarButton) ToolTip() string

type NSStatusItem

type NSStatusItem struct {
	objc.Object
}

func (NSStatusItem) Action

func (i NSStatusItem) Action() objc.Selector

func (NSStatusItem) Button

func (i NSStatusItem) Button() NSStatusBarButton

func (NSStatusItem) Menu

func (i NSStatusItem) Menu() NSMenu

func (NSStatusItem) SetAction

func (i NSStatusItem) SetAction(sel objc.Selector)

func (NSStatusItem) SetMenu

func (i NSStatusItem) SetMenu(menu NSMenu)

func (NSStatusItem) SetTarget

func (i NSStatusItem) SetTarget(obj objc.Object)

func (NSStatusItem) Target

func (i NSStatusItem) Target() objc.Object

type NSTextAlignment

type NSTextAlignment uint
const (
	NSTextAlignmentLeft      NSTextAlignment = 0
	NSTextAlignmentRight     NSTextAlignment = 1
	NSTextAlignmentCenter    NSTextAlignment = 2
	NSTextAlignmentJustified NSTextAlignment = 3
	NSTextAlignmentNatural   NSTextAlignment = 4
)

type NSTextContainer

type NSTextContainer struct {
	objc.Object
}

func (NSTextContainer) HeightTracksTextView

func (tc NSTextContainer) HeightTracksTextView() bool

func (NSTextContainer) SetHeightTracksTextView

func (tc NSTextContainer) SetHeightTracksTextView(b bool)

func (NSTextContainer) Size

func (tc NSTextContainer) Size() (size core.NSSize)

type NSTextView

type NSTextView struct {
	NSView
}

func NSTextView_Init

func NSTextView_Init(frame core.NSRect) NSTextView

func (NSTextView) Alignment

func (v NSTextView) Alignment() NSTextAlignment

func (NSTextView) DrawsBackground

func (v NSTextView) DrawsBackground() bool

func (NSTextView) Editable

func (v NSTextView) Editable() bool

func (NSTextView) FieldEditor

func (v NSTextView) FieldEditor() bool

func (NSTextView) Font

func (v NSTextView) Font() NSFont

func (NSTextView) ImportsGraphics

func (v NSTextView) ImportsGraphics() bool

func (NSTextView) LayoutManager

func (v NSTextView) LayoutManager() NSLayoutManager

func (NSTextView) RichText

func (v NSTextView) RichText() bool

func (NSTextView) Selectable

func (v NSTextView) Selectable() bool

func (NSTextView) SetAlignment

func (v NSTextView) SetAlignment(d NSTextAlignment)

func (NSTextView) SetDrawsBackground

func (v NSTextView) SetDrawsBackground(b bool)

func (NSTextView) SetEditable

func (v NSTextView) SetEditable(b bool)

func (NSTextView) SetFieldEditor

func (v NSTextView) SetFieldEditor(b bool)

func (NSTextView) SetFont

func (v NSTextView) SetFont(f NSFont)

func (NSTextView) SetImportsGraphics

func (v NSTextView) SetImportsGraphics(b bool)

func (NSTextView) SetLayoutManager

func (v NSTextView) SetLayoutManager(lm NSLayoutManager)

func (NSTextView) SetRichText

func (v NSTextView) SetRichText(b bool)

func (NSTextView) SetSelectable

func (v NSTextView) SetSelectable(b bool)

func (NSTextView) SetString

func (v NSTextView) SetString(s string)

func (NSTextView) SetTextColor added in v0.1.0

func (v NSTextView) SetTextColor(c NSColor)

func (NSTextView) SetTextContainer

func (v NSTextView) SetTextContainer(tc NSTextContainer)

func (NSTextView) String

func (v NSTextView) String() string

func (NSTextView) TextContainer

func (v NSTextView) TextContainer() NSTextContainer

type NSView

type NSView struct {
	objc.Object
}

func NSView_Init

func NSView_Init(frame core.NSRect) NSView

func (NSView) AddSubviewPositionedRelativeTo

func (v NSView) AddSubviewPositionedRelativeTo(subview objc.Object, positioned int, relativeTo objc.Object)

func (NSView) BackgroundColor

func (v NSView) BackgroundColor() NSColor

func (NSView) Bounds

func (v NSView) Bounds() (frame core.NSRect)

func (NSView) Frame

func (v NSView) Frame() (frame core.NSRect)

func (NSView) Layer

func (v NSView) Layer() core.CALayer

func (NSView) Opaque

func (v NSView) Opaque() bool

func (NSView) SetBackgroundColor

func (v NSView) SetBackgroundColor(color NSColor)

func (NSView) SetBoundsOrigin

func (v NSView) SetBoundsOrigin(p core.NSPoint)

func (NSView) SetBoundsSize

func (v NSView) SetBoundsSize(s core.NSSize)

func (NSView) SetFrameOrigin

func (v NSView) SetFrameOrigin(p core.NSPoint)

func (NSView) SetFrameSize

func (v NSView) SetFrameSize(s core.NSSize)

func (NSView) SetOpaque

func (v NSView) SetOpaque(b bool)

func (NSView) SetValueForKey

func (v NSView) SetValueForKey(value, key objc.Object)

func (NSView) SetWantsLayer

func (v NSView) SetWantsLayer(b bool)

func (NSView) WantsLayer

func (v NSView) WantsLayer() bool

type NSVisualEffectView

type NSVisualEffectView struct {
	objc.Object
}

func NSVisualEffectView_New

func NSVisualEffectView_New() NSVisualEffectView

type NSWindow

type NSWindow struct {
	objc.Object
}

func NSWindow_Init

func NSWindow_Init(rect core.NSRect, windowStyle core.NSUInteger, bufferingType NSBackingStoreType, deferCreation bool) NSWindow

func NSWindow_New

func NSWindow_New() NSWindow

func NSWindow_WithContentViewController

func NSWindow_WithContentViewController(controller objc.Object) NSWindow

func (NSWindow) BackgroundColor

func (w NSWindow) BackgroundColor() NSColor

func (NSWindow) Center

func (w NSWindow) Center()

func (NSWindow) Close

func (w NSWindow) Close()

func (NSWindow) CollectionBehavior

func (w NSWindow) CollectionBehavior() int64

func (NSWindow) ContentRectForFrameRect

func (w NSWindow) ContentRectForFrameRect(frameRect core.NSRect) (rect core.NSRect)

func (NSWindow) ContentView

func (w NSWindow) ContentView() NSView

func (NSWindow) Display

func (w NSWindow) Display()

func (NSWindow) Frame

func (w NSWindow) Frame() (frame core.NSRect)

func (NSWindow) HasShadow added in v0.0.3

func (w NSWindow) HasShadow() bool

HasShadow returns a Boolean value that indicates whether the window has a shadow. https://developer.apple.com/documentation/appkit/nswindow/1419234-hasshadow?language=objc

func (NSWindow) IgnoresMouseEvents

func (w NSWindow) IgnoresMouseEvents() bool

func (NSWindow) IsVisible

func (w NSWindow) IsVisible() bool

func (NSWindow) Level

func (w NSWindow) Level() int64

func (NSWindow) MakeKeyAndOrderFront

func (w NSWindow) MakeKeyAndOrderFront(sender objc.Object)

func (NSWindow) MovableByWindowBackground

func (w NSWindow) MovableByWindowBackground() bool

func (NSWindow) Opaque

func (w NSWindow) Opaque() bool

func (NSWindow) OrderBack added in v0.0.3

func (w NSWindow) OrderBack(sender objc.Object)

OrderBack moves the window to the back of its level in the screen list, without changing either the key window or the main window. https://developer.apple.com/documentation/appkit/nswindow/1419204-orderback?language=objc

func (NSWindow) OrderFront added in v0.0.3

func (w NSWindow) OrderFront(sender objc.Object)

OrderFront moves the window to the front of its level in the screen list, without changing either the key window or the main window. https://developer.apple.com/documentation/appkit/nswindow/1419495-orderfront?language=objc

func (NSWindow) OrderOut added in v0.0.3

func (w NSWindow) OrderOut(sender objc.Object)

OrderOut removes the window from the screen list, which hides the window. https://developer.apple.com/documentation/appkit/nswindow/1419660-orderout?language=objc

func (NSWindow) SetBackgroundColor

func (w NSWindow) SetBackgroundColor(color NSColor)

func (NSWindow) SetCollectionBehavior

func (w NSWindow) SetCollectionBehavior(collectionBehavior int)

func (NSWindow) SetContentView

func (w NSWindow) SetContentView(view objc.Object)

func (NSWindow) SetFrameDisplay

func (w NSWindow) SetFrameDisplay(frame core.NSRect, display bool)

func (NSWindow) SetHasShadow added in v0.0.3

func (w NSWindow) SetHasShadow(b bool)

SetHasShadow sets a Boolean value that indicates whether the window has a shadow. https://developer.apple.com/documentation/appkit/nswindow/1419234-hasshadow?language=objc

func (NSWindow) SetIgnoresMouseEvents

func (w NSWindow) SetIgnoresMouseEvents(b bool)

func (NSWindow) SetLevel

func (w NSWindow) SetLevel(level int)

func (NSWindow) SetMovableByWindowBackground

func (w NSWindow) SetMovableByWindowBackground(b bool)

func (NSWindow) SetOpaque

func (w NSWindow) SetOpaque(b bool)

func (NSWindow) SetStyleMask

func (w NSWindow) SetStyleMask(mask int)

func (NSWindow) SetTitle

func (w NSWindow) SetTitle(title string)

func (NSWindow) SetTitleVisibility

func (w NSWindow) SetTitleVisibility(v int)

func (NSWindow) SetTitlebarAppearsTransparent

func (w NSWindow) SetTitlebarAppearsTransparent(b bool)

func (NSWindow) StyleMask

func (w NSWindow) StyleMask() int64

func (NSWindow) Title

func (w NSWindow) Title() string

func (NSWindow) TitleVisibility

func (w NSWindow) TitleVisibility() int64

func (NSWindow) TitlebarAppearsTransparent

func (w NSWindow) TitlebarAppearsTransparent() bool

func (NSWindow) ToggleFullScreen

func (w NSWindow) ToggleFullScreen(s objc.Object)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL