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
12
votes
0 answers

NSCollectionView drag and drop placeholder size

I've managed to get drag and drop working on my NSCollectionView, but there are some issues with the visual appearance and behaviour. The main issue is that the drop zone / placeholder is the wrong size i.e. it's smaller than the collection view's…
Luke Rogers
  • 2,369
  • 21
  • 28
12
votes
2 answers

Snow Leopard & LSUIElement -> application not activating properly, window not "active" despite being "key"

I'm running into a few problem with a background application that uses LSUIElement=1 to hide its dock item, menu bar and prevent it from appearing in the Command-Tab application switcher. It seems to be a Snow Leopard only problem. The application…
Frank R.
  • 2,328
  • 1
  • 24
  • 44
12
votes
5 answers

Transparent background WKWebView (NSView)

I am building a Mac application using Swift. Therefor, I want to make a WKWebView transparent, so it shows the text of the loaded HTML, but the background of my underlaying NSWindow is visible. I tried webView.layer?.backgroundColor =…
danielbuechele
  • 3,104
  • 2
  • 18
  • 29
11
votes
4 answers

SwiftUI: How to disable the "smart quotes" in TextEditor

I'm developing a Python-based graphic calculator for MacOS using SwiftUI. https://github.com/snakajima/macplot I am using SwiftUI's TextEditor as the editor for Python code, but I am not able to figure out how to disable the smart quote…
Satoshi Nakajima
  • 1,863
  • 18
  • 29
11
votes
2 answers

How to right-align item labels in a custom SwiftUI form on AppKit?

I have the following Cocoa form: struct Canvas: PreviewProvider { static var previews: some View { VStack { HStack(alignment: .firstTextBaseline) { Text("Endpoint:") TextField("https://localhost:8080/api", text:…
Vadim
  • 9,383
  • 7
  • 36
  • 58
11
votes
1 answer

Strange scrolling on NSTextField

I have a NSTextField that I try to resize automatically given a certain criteria whenever the content of it changes. Sometimes, when start typing the content start moving up (or down) the visible part of the text field as shown in the following…
fespinozacast
  • 2,484
  • 4
  • 23
  • 38
11
votes
1 answer

How do you get smooth high-rate playback from AVPlayer?

AVPlayer has a property called rate that is meant to control the playback rate. 1.0 is normal speed while values like 2.0 or 5.0 should playback at 2x and 5x respectively. Whenever I set a playback rate value higher than 1.0 (say 10.0), the playback…
kennyc
  • 5,490
  • 5
  • 34
  • 57
11
votes
5 answers

Separator item in NSPopupButton with bindings

The contents of a NSPopupButton are bound to an NSArray of strings. How can we insert a separator item via bindings? The "-" strings (like in the olden/Classic days) doesn't work, i.e. shows up literally as a "-" menu item. Is there any…
ATV
  • 4,116
  • 3
  • 23
  • 42
11
votes
4 answers

Automatically wrap NSTextField using Auto Layout

How does one go about having auto-layout automatically wrap an NSTextField to multiple lines as the width of the NSTextField changes? I have numerous NSTextFields displaying static text (i.e.: labels) in an inspector pane. As the inspector pane is…
kennyc
  • 5,490
  • 5
  • 34
  • 57
11
votes
1 answer

What is the correct way to self-terminate a MacOS XPC service?

I've successfully followed the Daemons and Service Guide - Creating XPC Services tutorial, along with the SandboxedFetch sample code and have a working Client / Service setup that is using the new NSXPCConnection class. What still isn't entirely…
kennyc
  • 5,490
  • 5
  • 34
  • 57
10
votes
2 answers

NSPopUpButton set it to the first item

I have a clear button in my Mac OS app. When the button is pressed, it clears all the values of the form and resets the NSPopUpButton to the first item. The question is how do I change the NSPopUpButton control with code. Thanks
Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177
10
votes
2 answers

NSNumberFormatter doesn't allow typing decimal numbers

I am totally bewildered using NSNumberFormatter. This should be totally simple but I can't get it to work. I'd like to set an NSTextField to allow typing decimal numbers, either with a decimal point or without. Here is what I'd think would…
btschumy
  • 1,435
  • 1
  • 18
  • 35
10
votes
1 answer

NSTableView has unwanted space above first row

I have an NSTableView whose first row is pushed down 10 pt from the top. Headers are turned off, there are no group rows, cell spacing is 0, and the enclosing scroll view's content inset is 0. UPDATED Here's a sample project that demonstrates the…
smr
  • 890
  • 7
  • 25
10
votes
1 answer

How to set the content and scrolling insets on WKWebView?

The WKWebView class doesn't support the scrollView property on macOS. Moreover it's view hierarchy doesn't contain an NSScrollView instance (I've checked using view debugging on 10.12) Now is there another way to set the scrolling insets and content…
adib
  • 8,285
  • 6
  • 52
  • 91
10
votes
0 answers

How do automatically resize an NSPopover with auto layout

I currently have an NSPopover subclass which sets it content view controller to a custom NSViewController meant to represent a tab view: self.popover.contentViewController = tabViewController; self.popover.animates = YES; I'm rolling my own…
JPC
  • 8,096
  • 22
  • 77
  • 110