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
16
votes
3 answers

NSTextField placeholder text doesn't show unless editing

I set the placeholder text of my NSTextField in Interface Builder, but the placeholder text doesn't show until I click inside the text field to edit it.
indragie
  • 18,002
  • 16
  • 95
  • 164
16
votes
1 answer

UITextView – can't set underline or strikethrough attributes on text?

I'm getting runtime failures whenever I try to set underline or strikethrough attributes on the attributedText of a UITextView. Other properties, like font and background color have no problems. Here's a code snippet. All I have is a test project…
Adam Bryant
  • 545
  • 3
  • 13
16
votes
1 answer

How to call NSScrollView autoscroll-method programmatically

I have simple chat application with text messages view-based NSTableView as you can see at the picture below. Each message contains NSTextView instance having height to fit all the text. All I need is to start NSScrollView (which…
Daniyar
  • 2,975
  • 2
  • 26
  • 39
16
votes
4 answers

NSWindow: change positions of window buttons

I want to fake a titlebar (bigger and with a different color), so my way until now is the following: I added a NSView directly below the titlebar and then I set the titlebar to transparent with this code: self.window.titlebarAppearsTransparent =…
Lupurus
  • 3,618
  • 2
  • 29
  • 59
16
votes
2 answers

How do you use the dark vibrancy on an NSWindow?

What is the correct way to use the Vibrant Dark (NSAppearanceNameVibrantDark) or Vibrant Light (NSAppearanceNameVibrantLight) modes with an NSWindow? I'm building an application and would like to offer the new Vibrant Dark appearance as an option…
kennyc
  • 5,490
  • 5
  • 34
  • 57
16
votes
2 answers

Replacements for the deprecated NSNibLoading methods (loadNibFile:, loadNibNamed:, etc.)?

I have found that the NSNibLoading methods in NSBundle: +[NSBundle loadNibFile:externalNameTable:withZone:] +[NSBundle loadNibNamed:owner:] -[NSBundle loadNibFile:externalNameTable:withZone:] have all been marked deprecated in 10.8 - what is the…
maseth
  • 841
  • 1
  • 11
  • 19
16
votes
5 answers

Import Error: No module named AppKit

I use Mac OS X Lion and Python 2.7. I am new to python. Can anyone tell me how to import AppKit and PyObjC to Python. But i get the errors when trying to import Import Error: No module named AppKit or 'Import Error: No module named PyObjC. Trying…
VeilEclipse
  • 2,766
  • 9
  • 35
  • 53
16
votes
1 answer

When developing in AppKit, why does IB create a property that is assign, rather than retain?

I'm an experienced iOS dev and I have decided to try my hand at some AppKit development. There are a couple of adjustments that I am making API-wise, but otherwise am finding OS X development to be, shall we say, 'familiar'. I've been building my…
Wayne Hartman
  • 18,369
  • 7
  • 84
  • 116
15
votes
2 answers

How to end editing in NSTextFieldCell inside NSOutlineView after ESC key is pressed

I'm trying to get a custom NSTextFieldCell (inside a NSOutlineView) to end editing when the ESC key is pressed but cannot find any way to accomplish this. I tried to add an observer for the NSControlTextDidChangeNotification-notification but it is…
finnsson
  • 4,037
  • 2
  • 35
  • 44
14
votes
1 answer

How to make action to close NSPopover?

Hi I implemented an NSPopover in one of my apps, but the popover will not close. I'm guessing that it should close once I click something else, but its not. I know that there's a close popover action but that only works for a different button. How…
sridvijay
  • 1,526
  • 18
  • 39
14
votes
2 answers

Get Certificates in Keychain

I've looked over the Security framework documentation but I can't seem to be able to find a way to get all of the certificates on a given keychain. Are there methods to accomplish this?
Dylan Copeland
  • 1,249
  • 1
  • 11
  • 20
14
votes
7 answers

UISwitch, something similar for Mac?

I’m sure most of you are familiar with the UISwitch on iOS. Is their any existing project trying to implement something like a UISwitch for macOS and AppKit? If not, where would one start to make one? I see them frequently and can think of so many…
nosedive25
  • 2,477
  • 5
  • 30
  • 45
14
votes
3 answers

Handling keyboard events in AppKit with Swift

I have a custom NSView subclass that needs to handle some keyboard events. In Objective-C, I might handle it like this: -(void)keyDown:(NSEvent *)event { unichar ch = [[event charactersIgnoringModifiers] characterAtIndex:0]; if (ch ==…
BJ Homer
  • 48,806
  • 11
  • 116
  • 129
13
votes
6 answers

Hide scrollers while leaving scrolling itself enabled in NSScrollView

I'd like to hide the NSScrollers of NSScrollView. I'm aware of the methods setHasHorizontalScroller: and setHasVerticalScroller:. However, if I disable the scrollers, scrolling in that direction gets disabled as well. I'd like to only hide the…
mplappert
  • 1,314
  • 11
  • 18
13
votes
3 answers

Setting a main window title for macOS SwiftUI app in AppKit?

I have a simplistic WKWebView app that opens up a website on macOS, using SwiftUI in AppKit. However, the app window has no title - I'm talking of the top row (with the red X to close it, etc. How do I set a title there? I've tried looking at…
esaruoho
  • 896
  • 1
  • 7
  • 25
1
2
3
95 96