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

How to get height for NSAttributedString at a fixed width

I want to do some drawing of NSAttributedStrings in fixed-width boxes, but am having trouble calculating the right height they'll take up when drawn. So far, I've tried: Calling - (NSSize) size, but the results are useless (for this purpose), as…
bonaldi
  • 992
  • 1
  • 8
  • 11
33
votes
3 answers

How to fade out a NSView with animation?

This is as simple as can be so I can't for the life of me find what's wrong, I looked through the documentation as a guide but it still didn't work. I have a view inside a larger view. An IBAction is supposed to fade out the inner view... that's it.…
Elbimio
  • 1,041
  • 2
  • 10
  • 25
31
votes
3 answers

Borderless NSButton turns gray when clicked

I am making a little application with three NSButtons with an image set. These buttons have no border nor background. However, when I click a button it turns into a gray rectangle. How can I fix this? Thanks.
user142019
28
votes
4 answers

Add Subview to NSWindow Titlebar

I want to create a custom Window Toolbar but without using an actual NSToolbar (because it doesn't behaves right in some cases for my needs and I can't style it the way I want), therefore I need to add a subview to the Window titlebar. It should…
27
votes
5 answers

How to handle with a default URL scheme

I want to build URI (or URL scheme) support in my app. I do a LSSetDefaultHandlerForURLScheme() in my + (void)initialize and I setted the specific URL schemes also in my info.plist. So I have URL schemes without Apple Script or Apple Events. When…
papr
  • 4,717
  • 5
  • 30
  • 38
23
votes
1 answer

NSEvent global event monitoring in background

I am writing a simple Mac application designed to run in the background and perform certain actions whenever the user clicks the mouse button. The app is written in Python using PyObjC. I am using addGlobalMonitorForEventsMatchingMask to watch for…
ekl
  • 1,052
  • 2
  • 9
  • 24
20
votes
5 answers

Editable TextField in SwiftUI List

UPDATE: 14 months later, there is this intriguing note in the AppKit release notes: A TextField that you are editing inside a selected List row now has correct text foreground colors. (68545878) Now when placing a TextField in a List, the…
marcprux
  • 9,845
  • 3
  • 55
  • 72
20
votes
5 answers

Symbol not found: _OBJC_IVAR_$_NSScroller._action in High Sierra

An application which worked on previous versions of MacOS fails on High Sierra with the following message: dyld: Symbol not found: _OBJC_IVAR_$_NSScroller._action Referenced from: Expected in: …
Malcolm McCaffery
  • 2,468
  • 1
  • 22
  • 43
20
votes
9 answers

Allow click and dragging a view to drag the window itself?

I'm using a textured window that has a tab bar along the top of it, just below the title bar. I've used -setContentBorderThickness:forEdge: on the window to make the gradient look right, and to make sure sheets slide out from the right…
d11wtq
  • 34,788
  • 19
  • 120
  • 195
19
votes
4 answers

No Module Named AppKit

I am trying to run an audio file in Python: from playsound import playsound def main(): playsound('audio.mp3') main() However, I keep getting the following error: File…
user5124826
19
votes
1 answer

How to get notified when NSWindow closes

how can I take notice when an NSWindow should or will get closed? I'd like to have something like the windowWillClose. Unfortunately NSWindowController does not have as much convenient methods as UIViewController has, for example. So what's the best…
flohei
  • 5,248
  • 10
  • 36
  • 61
18
votes
6 answers

Set Window Resizable

In IB this can be done easily by checking the 'Resize' checkbox on or off. My problem is I want my main NSWindow to not be resizable, until a button is clicked, and then i want it to be resizable. I've scoured the Internet but can't find anything?…
Cristian
  • 6,765
  • 7
  • 43
  • 64
17
votes
3 answers

how to disable LookUp (Dictionary, Thesaurus, Wikipedia) functionality within a NSTextView?

One of my projects is an testing app where a student shouldn't be able to easily look up words while they're typing. It's relatively easy to turn off automatic spelling checking in a NSTextView via setContinuousSpellCheckingEnabled: and…
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
16
votes
2 answers

How can I accept a drop for a dragged item on a window tab in macOS/AppKit?

In Safari, I can drag an item (like a URL or even a .webloc bookmark from the finder) right onto a tab to open. How do I make the window tab bar item view a drop target in my own AppKit app? I’d like to be able to accept dropping an NSPasteboard…
Frank R
  • 841
  • 5
  • 13
16
votes
1 answer

How can I get IOBluetoothDevice's battery level, using Swift and AppKit (Xcode for MacOS)

I am using Xcode to develop a MacOS app, based on Cocoa & AppKit, written in Swift. I am using IOBluetoothDevice objects throughout my app, and I want to be able to display the devices' battery levels, if accessible. I expect that devices which…
Ori
  • 1,680
  • 21
  • 24
1
2 3
95 96