nstouchbar

Adding NSTouchBar support after main window has been created

安稳与你 提交于 2019-12-24 01:12:31
问题 I'm trying to add support for exposing NSTouchBar buttons via a plugin to an application that I cannot otherwise modify. The plugin, a shared library, is loaded at runtime after the main window has been created. I've created an AppDelegate as follows: @interface AppDelegate : NSResponder <NSTouchBarDelegate> @end With an @implmentation that implements the makeTouchBar and touchBar functions: - (NSTouchBar *) makeTouchBar - (nullable NSTouchBarItem *) touchBar:(NSTouchBar *)touchBar

How can I make my application's touch bar always visible on macOS?

╄→尐↘猪︶ㄣ 提交于 2019-12-23 17:23:41
问题 I am making a macOS menu bar application which displays a fullscreen overlay. The user is able to control the opacity of this overlay via a slider in the menu bar. I wish to move these controls to the touch bar, because the application is used for screen recordings, and distractions on the main screen would be recorded. The slider in my application should act just like the brightness and volume sliders that are on the touch bar by default. I have added my NSTouchBar by subclassing

Is there programable access to the Control Strip of the macOS Touch Bar?

二次信任 提交于 2019-12-18 14:54:39
问题 The Control Strip is the static and global part of the macOS Touch Bar which is always visible in every context and app. While Apple provides full documentation about how to use the API to provide a contextual App Region in your macOS app, I couldn't find any notice about how to add stuff to the Control Strip . I could think of a lot of nice tools and actions which would be nice to have it always just a finger tip away, so I was wondering if we (the developers) are able to advance the Control

Replacing the ESC button on a NSTouchBar

血红的双手。 提交于 2019-12-12 17:31:12
问题 I am building a NSTouchBar for my app using storyboard. I want to replace the ESC button with something else. As usual, there is no doc telling you how to do that. I have searched the web and I have found vague informations like You can change the content of "esc" to something else, though, like "done" or anything, even an icon, by using escapeKeyReplacementItemIdentifier with the NSTouchBarItem. But this is too vague to understand. Any ideas? This is what I did so far. I have added a button

How to create an NSTouchBar from an NSWindow object?

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:57:41
问题 I'm trying to integrate touchbar support with an SDL application. I've gone into the objective c code in SDL and hacked directly into the SDLView code and gotten a working touchbar, but now I want to get the same functionality with the stock SDL2 library. SDL exposes the NSWindow object it creates and I think I can create a responder object with makeTouchBar and makeItemForIdentifier implemented, but I don't know how to "attach" it to the window. I think it would be a "responder chain" but I

Has Apple released APIs for touch bar yet?

☆樱花仙子☆ 提交于 2019-12-09 06:32:16
问题 Apple just announced the new MacBook with the touch bar. Are there APIs that app developers can use? I can't seem to find any online yet. Does it support access from the browser via JavaScript? WebKit has force touch APIs to support it on four runs touch trackpad) so I'm guessing it'll be pretty useful if they release this one too. Is anything out yet? Also how to debug and test for touch bar functions, is there some 'MAC EMULATOR' sort of thing? 回答1: I think this option is for native client,

How to add a scrollview in Touch Bar in Storyboard?

为君一笑 提交于 2019-12-08 14:49:05
问题 I am adding a few buttons to the Touch Bar in storyboard, everything works fine except that I can only fit about 4 buttons in there (since the buttons contain both image and text) in my education app. I would like to add a scrollview to contains all the buttons, but does not seem to be able to drag a ScrollView into the Touch Bar. What is the best way to have a scrollable set of buttons in Touch Bar? 回答1: You firstly need to insert Touch Bar View which can then contian NSScrollView . It

Update NSTouchBar on the fly to add/remove items programmatically

冷暖自知 提交于 2019-12-07 05:59:07
问题 I'm currently implementing the NSTouchBar api to my macOS application. At this moment, the only touch bar I have has the main View Controller as its delegate and I can add items to it fine. The catch is, I need some of those items to appear only when a certain condition is met (a row is selected in a table). Consider I have a boolean that indicates whether or not the button should be visible. How do I update the NSTouchBar on the fly to show/hide this button in case my boolean changes? (I don

Update NSTouchBar on the fly to add/remove items programmatically

巧了我就是萌 提交于 2019-12-05 12:10:58
I'm currently implementing the NSTouchBar api to my macOS application. At this moment, the only touch bar I have has the main View Controller as its delegate and I can add items to it fine. The catch is, I need some of those items to appear only when a certain condition is met (a row is selected in a table). Consider I have a boolean that indicates whether or not the button should be visible. How do I update the NSTouchBar on the fly to show/hide this button in case my boolean changes? (I don't need to observe this boolean, I could simply make the call to update in another method I already

Is there programable access to the Control Strip of the macOS Touch Bar?

落花浮王杯 提交于 2019-11-30 12:00:21
The Control Strip is the static and global part of the macOS Touch Bar which is always visible in every context and app. While Apple provides full documentation about how to use the API to provide a contextual App Region in your macOS app, I couldn't find any notice about how to add stuff to the Control Strip . I could think of a lot of nice tools and actions which would be nice to have it always just a finger tip away, so I was wondering if we (the developers) are able to advance the Control Strip too? Is there any documentation or did anybody figure it out himself how to work wit Control