Questions tagged [appkit]

The Application Kit is a collection of classes provided by OpenStep operating systems such as OPENSTEP, GNUstep, and Mac OS X.

The Application Kit is a collection of classes provided by OpenStep operating systems such as OPENSTEP, GNUstep, and Mac OS X.

Apple's reference documentation describes AppKit as follows:

AppKit contains all the objects you need to implement the user interface for a macOS app—windows, panels, buttons, menus, scrollers, and text fields—and it handles all the details for you as it efficiently draws on the screen, communicates with hardware devices and screen buffers, clears areas of the screen before drawing, and clips views.

Reference

1436 questions
9
votes
3 answers

How do find out if there is a full-screen app running on a specific NSScreen

In Cocoa/AppKit, given a screen from [NSScreen screens], how can I find out if there's a full-screen app running on that specific screen? I'm mostly interested in apps that use the Cocoa APIs for full-screen, but if there's a solution that also…
thomasfuchs
  • 5,386
  • 2
  • 18
  • 38
9
votes
2 answers

Why is AppKit destroying my "Saved Application State" folder on normal app termination?

SETUP: OS X 10.9.0 (13A603) Xcode Version 5.0.2 (5A3005) Normal Cocoa Document-Based Application I have developed a typical Cocoa Document-Based OS X Application. My intention is to support Apple's User Interface Preservation feature to restore…
Todd Ditchendorf
  • 11,217
  • 14
  • 69
  • 123
9
votes
3 answers

View-based NSOutlineView without NIB?

NSOutlineView is a subclass of NSTableView. And currently, NSTableView supports two implementations. Cell-based. View-based. To make OSX 10.8 Finder style side bar (with automatic gray Icon styling), need to use view-based table view with…
eonil
  • 83,476
  • 81
  • 317
  • 516
9
votes
4 answers

How find out if I'm an NSButton with buttonType NSSwitchButton?

I'm subclassing NSButtonCell to customize the drawing (customizable theme). I'd like to customize the way checkboxes and radio buttons are drawn. Does anyone know how to detect whether a button is a checkbox or radio button? There is only…
uliwitness
  • 8,532
  • 36
  • 58
9
votes
1 answer

How to make NSView not clip its bounding area?

I created an empty Cocoa app on Xcode for OS X, and added: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { self.view = [[NSView alloc] initWithFrame:NSMakeRect(100, 100, 200, 200)]; self.view.wantsLayer = YES; …
Jeremy L
  • 3,770
  • 6
  • 41
  • 62
9
votes
1 answer

Correctly resizing rows on view-based NSTableView

A view-based NSTableView with rows that have dynamic heights doesn't resize its rows when the table view size is changed. This is a problem when the row height is derived from the table view's width (think text blocks that fills a column and wraps…
adib
  • 8,285
  • 6
  • 52
  • 91
8
votes
1 answer

Check if a sheet is open

I'm writing a Cocoa app and basically I have a window and I need to check if a sheet is open before I open another window. Google doesn't seem to know that one. How may I check if the sheet is open or not?
Fernando Valente
  • 1,096
  • 1
  • 8
  • 30
8
votes
1 answer

Being apprised of when NSStatusItem is hidden

I have an app which uses an NSStatusItem. On small screens there's not much space in the status bar. When a user switches to an application with a lot of menu items, my status item gets hidden. Is there a way to get notified about this? What I tried…
stigi
  • 6,661
  • 3
  • 40
  • 50
8
votes
2 answers

java.lang.NoSuchMethodError:accessibilityHitTest

I'm using Sikulix 2.0.6. There is an error in the message field: java.lang.NoSuchMethodError:accessibilityHitTest I looked https://github.com/openjdk/jdk/pull/5702 but still don't know how to fix it. and my terminal log: Exception in thread "AppKit…
Tatsuhiko Mizuno
  • 437
  • 6
  • 15
8
votes
0 answers

Animate NSWindow's size change based on SwiftUI changes

By default, an NSWindow that hosts a SwiftUI view will automatically resize to fit the size of the view if/when it changes. However, if the changes are animated, the window jumps to the final size without animating. Is there a way to animate the…
8
votes
1 answer

Send file URL and args to (running) macOS app via command line

I've been trying to create a way to tell my (running) macOS app to open some files and supply some additional arguments to the command. For cold-start apps, using the $ open MyApp.app fileA.txt --args --foo-arg would launch the app and I would be…
Andyy
  • 485
  • 8
  • 27
8
votes
1 answer

Using NSTableView in SwiftUI?

Has anyone gotten NSTableView to work with SwiftUI? Whenever I run my code my app will not load but there are also no errors. There aren't any examples for tableviews but I thought it would be using the NSViewControllerRepresentable. I'm not…
lostAstronaut
  • 1,331
  • 5
  • 20
  • 34
8
votes
1 answer

How to implement zoom/scale in a Cocoa AppKit-application

How do you implement zoom/scale in a Cocoa AppKit-application (i.e. not maximizing the window but scaling the window and all its subviews)? I think it's called zoomScale in iOS. Can it be done using Core Animations or Quartz 2D (e.g.…
finnsson
  • 4,037
  • 2
  • 35
  • 44
8
votes
2 answers

Programmatically resizing NSSplitView

I used to use and love RBSplitView, however I failed at reimplementing it programmatically as a certain version of xcode does not support IB plugins anymore. Therefore I went back to using NSSplitView. NSSplitView is fine for what I need, the thing…
Antwan van Houdt
  • 6,989
  • 1
  • 29
  • 52
8
votes
5 answers

How to use custom NSView in Interface Builder?

I have watched numerous tutorials on how to create a custom View in Interface Builder. All are for iOS but MacOS should be similar, no? I have tried a few methods but none are completely successful. The init(coder:) calls the NIB instantiation…
Bill Waggoner
  • 452
  • 3
  • 11