#appkit — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #appkit, aggregated by home.social.
-
I was doing a Recent Searches menu for my AppKit Search Field... The API is a bit odd... very un-AppKit... but I found this super helpful doc. Of course it is the Documentation Archive Apple still has up...
See: “Configuring a Menu Template”
But this was initially published in 2003!!! The API is pretty much the same for at least 23 years now!!! 🤯
Anyway, it was to add this menu when you click on the Magnifying Glass icon.
-
I was doing a Recent Searches menu for my AppKit Search Field... The API is a bit odd... very un-AppKit... but I found this super helpful doc. Of course it is the Documentation Archive Apple still has up...
See: “Configuring a Menu Template”
But this was initially published in 2003!!! The API is pretty much the same for at least 23 years now!!! 🤯
Anyway, it was to add this menu when you click on the Magnifying Glass icon.
-
Another HacKit detail I’ve wanted to improve for years is finally done.
The Appearance pane used to hide the author badge colours inside a pop-up button. I’ve replaced it with coloured radio buttons, so the whole palette is visible at a glance and changing colour is immediate.
A small change, but exactly the kind of detail I care about in a native Mac app.
Coming in the next major HacKit update.
-
Another HacKit detail I’ve wanted to improve for years is finally done.
The Appearance pane used to hide the author badge colours inside a pop-up button. I’ve replaced it with coloured radio buttons, so the whole palette is visible at a glance and changing colour is immediate.
A small change, but exactly the kind of detail I care about in a native Mac app.
Coming in the next major HacKit update.
-
One feature I’ve wanted to add to HacKit for years is finally done.
The next major update introduces the Find Bar, so finding text in stories works just as you expect.
Getting NSTextFinder working outside of NSTextView was a challenge, but I’m delighted with the result.
#HacKit #AppKit #Cocoa #Swift #NSTextFinder #MacDev #macOSDev
-
One feature I’ve wanted to add to HacKit for years is finally done.
The next major update introduces the Find Bar, so finding text in stories works just as you expect.
Getting NSTextFinder working outside of NSTextView was a challenge, but I’m delighted with the result.
#HacKit #AppKit #Cocoa #Swift #NSTextFinder #MacDev #macOSDev
-
I wish Apple would still provide documentation with this level of detail... I mean, look at the start of this index page...
• Advantages of using bindings
• A simple example
• Why are NSControllers useful?
• Real-world example
• How do Bindings work?
• Bindings in more detail
...
• Troubleshooting (WHAAAT?!)etc etc.
Just imagine if we had documentation like this today for all of Apple's technologies. Would be so amazing.
#macOS #MacOSX #MacDev #AppKit #CocoaBindings
https://leopard-adc.pepas.com/documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.pdf
-
I wish Apple would still provide documentation with this level of detail... I mean, look at the start of this index page...
• Advantages of using bindings
• A simple example
• Why are NSControllers useful?
• Real-world example
• How do Bindings work?
• Bindings in more detail
...
• Troubleshooting (WHAAAT?!)etc etc.
Just imagine if we had documentation like this today for all of Apple's technologies. Would be so amazing.
#macOS #MacOSX #MacDev #AppKit #CocoaBindings
https://leopard-adc.pepas.com/documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.pdf
-
RE: https://mastodon.social/@marioguzman/116950572824369906
I have fully refactored my upcoming app's sidebar to use NSTreeController + Cocoa Bindings to my NSOutlineView.
A bit of a learning curve but I do think my code is cleaner and I have all my functions like drag + drop, inserting + deleting rows, preserving collapsed state, contextual menus per item type all still working as before. Tested across Sequoia, Tahoe, and Golden Gate and the UI just updates "auto-magically" 😄.
Totally worth reading all I could find on NSTreeController.
#macOS #AppKit -
RE: https://mastodon.social/@marioguzman/116950572824369906
I have fully refactored my upcoming app's sidebar to use NSTreeController + Cocoa Bindings to my NSOutlineView.
A bit of a learning curve but I do think my code is cleaner and I have all my functions like drag + drop, inserting + deleting rows, preserving collapsed state, contextual menus per item type all still working as before. Tested across Sequoia, Tahoe, and Golden Gate and the UI just updates "auto-magically" 😄.
Totally worth reading all I could find on NSTreeController.
#macOS #AppKit -
@DebianAstro To tag it for better availability: This is a #Cocoa and #GNUstep application.
-
@DebianAstro To tag it for better availability: This is a #Cocoa and #GNUstep application.
-
@bwebster @mjtsai – So far getting exactly what I need using bindings and NSTreeController just fine. I can add to my backing tree and have it just do its thing to update the UI for me. Menus works perfectly… Collapsed state persisting between app launches is working as expected... The last thing I need is to check if drag and drop into a leaf node works. If it does, I am all set. But so far, it's working nicely! :)
-
@bwebster @mjtsai – So far getting exactly what I need using bindings and NSTreeController just fine. I can add to my backing tree and have it just do its thing to update the UI for me. Menus works perfectly… Collapsed state persisting between app launches is working as expected... The last thing I need is to check if drag and drop into a leaf node works. If it does, I am all set. But so far, it's working nicely! :)
-
I read somewhere (forget where), that if you use NSOutlineView w/ NSTreeController, that the collapsed state for groups would be persisted for you if you only set `autosaveExpandedItems` + `autosaveName`.
Except I haven't found this to be the case and I have to manually override the persistent for id/object data source functions myself. Which is fine; very straightforward.
But just wondering if this is correct/incorrect... it works; but it goes against what I previously read.
-
I read somewhere (forget where), that if you use NSOutlineView w/ NSTreeController, that the collapsed state for groups would be persisted for you if you only set `autosaveExpandedItems` + `autosaveName`.
Except I haven't found this to be the case and I have to manually override the persistent for id/object data source functions myself. Which is fine; very straightforward.
But just wondering if this is correct/incorrect... it works; but it goes against what I previously read.
-
-
-
Spent the day reading every bit of NSTreeController + NSOutlineViews with Cocoa Bindings I could find and now... I created something I needed (sans Storyboard too) for my project. This was just my playground app...
But I got what I needed. All I have to do is just insert into the bound array, and voila... everything in the UI gets updated auto-magically. And no more need for `NSOutlineViewDataSource`. :)
I can now get rid of a great deal of stupid code & I learned a ton.
-
Spent the day reading every bit of NSTreeController + NSOutlineViews with Cocoa Bindings I could find and now... I created something I needed (sans Storyboard too) for my project. This was just my playground app...
But I got what I needed. All I have to do is just insert into the bound array, and voila... everything in the UI gets updated auto-magically. And no more need for `NSOutlineViewDataSource`. :)
I can now get rid of a great deal of stupid code & I learned a ton.
-
I just want to try because preserving selection, not having to manually reload certain sections, or all of it either, etc etc would be nice if I could just let the tree controller and bindings just handle it for me. I’m sure once I understand it, it would be magical. I just need a good reference doc and can’t find something even adequate. @jonmsterling
@mattiem
@curthard89 -
I just want to try because preserving selection, not having to manually reload certain sections, or all of it either, etc etc would be nice if I could just let the tree controller and bindings just handle it for me. I’m sure once I understand it, it would be magical. I just need a good reference doc and can’t find something even adequate. @jonmsterling
@mattiem
@curthard89 -
Does anyone have a good example of using NSTreeController and NSOutlineView together with Cocoa Bindings? The documentation and the one example I found aren't... great.
-
Does anyone have a good example of using NSTreeController and NSOutlineView together with Cocoa Bindings? The documentation and the one example I found aren't... great.
-
Latest testflight build of #McKinley, my SF Symbols creation app, now has an animation preview palette. Like the regular preview, this uses Apple's SF Symbol rendering, so you should get an accurate preview of how the symbol will behave in your app.
(Not supported yet, the new Draw on/off animation type.)
-
Latest testflight build of #McKinley, my SF Symbols creation app, now has an animation preview palette. Like the regular preview, this uses Apple's SF Symbol rendering, so you should get an accurate preview of how the symbol will behave in your app.
(Not supported yet, the new Draw on/off animation type.)
-
I got it! You want to just use the menu property on NSOutlineView/NSTableView directly. Give it an empty menu & set the menu's delegate. Then you can conform to NSMenuDelegate & use `func menuWillOpen(_ menu: NSMenu)` in order to add/edit/remove any menu items.
But doing it this way will automatically outline/border the item you opened the contextual menu for and doesn't have to fully-select.
@rickfillion @Gte @bwebster @axiixc @GeekAndDad
Thanks everyone! Brian's suggestion was it!
-
I got it! You want to just use the menu property on NSOutlineView/NSTableView directly. Give it an empty menu & set the menu's delegate. Then you can conform to NSMenuDelegate & use `func menuWillOpen(_ menu: NSMenu)` in order to add/edit/remove any menu items.
But doing it this way will automatically outline/border the item you opened the contextual menu for and doesn't have to fully-select.
@rickfillion @Gte @bwebster @axiixc @GeekAndDad
Thanks everyone! Brian's suggestion was it!
-
For the time being, I am calling `selectRowIndexes(_:byExtendingSelection:)` because I don't know any better. It looks like this... but this isn't the correct behavior. As it is visually wrong and it also updates the details side of my NSSplitViewController because it triggered the selection changed event.
-
For the time being, I am calling `selectRowIndexes(_:byExtendingSelection:)` because I don't know any better. It looks like this... but this isn't the correct behavior. As it is visually wrong and it also updates the details side of my NSSplitViewController because it triggered the selection changed event.
-
Any #AppKit gurus: I was wondering if you are be able to help me with something. How do you achieve this highlight when providing a contextual menu to a row in NSOutlineView?
In a way, it "selects it" by doing a highlight-ring around it but isn't really selecting it as it doesn't trigger the selection changed event.
Can't really call `selectRowIndexes(_:byExtendingSelection:)` because that does a normal highlight and triggers the selection changed event.
This is what I want: (like in Finder).
-
Any #AppKit gurus: I was wondering if you are be able to help me with something. How do you achieve this highlight when providing a contextual menu to a row in NSOutlineView?
In a way, it "selects it" by doing a highlight-ring around it but isn't really selecting it as it doesn't trigger the selection changed event.
Can't really call `selectRowIndexes(_:byExtendingSelection:)` because that does a normal highlight and triggers the selection changed event.
This is what I want: (like in Finder).
-
Interface Builder’s NSGridView editor is SO BUGGY it's untrue!
I am regretting trying to do these inspector panes in IB. I was working on the assumption "I'm making an old school Mac app, and we _used to_ use IB for this kind of thing” — but that was before the quality got way worse!
-
Interface Builder’s NSGridView editor is SO BUGGY it's untrue!
I am regretting trying to do these inspector panes in IB. I was working on the assumption "I'm making an old school Mac app, and we _used to_ use IB for this kind of thing” — but that was before the quality got way worse!
-
Wow. A mastodon client is really a lot of stuff. I think I have now touched almost every endpoint. 😅
-
Wow. A mastodon client is really a lot of stuff. I think I have now touched almost every endpoint. 😅
-
Importing Material Design icons and rendering as SF Symbols…
(Well, _someone_ might want to!)
-
Importing Material Design icons and rendering as SF Symbols…
(Well, _someone_ might want to!)
-
Thought I'd do #AppleScript support for this one…
-
Thought I'd do #AppleScript support for this one…
-
I had to add a custom drawer because I couldn’t bear unsupported dark mode any more.
However, there’s still an option to revert to the old version if you don’t mind. -
I had to add a custom drawer because I couldn’t bear unsupported dark mode any more.
However, there’s still an option to revert to the old version if you don’t mind. -
Настоящий Liquid Glass, как у системного HUD на macOS 26, через приватные API
Я хотел сделать маленькую OSD-панель яркости на macOS так, чтобы она выглядела как системный HUD: не просто полупрозрачная плашка поверх обоев, а нормальное стекло, через которое видно и немного преломляется рабочий стол. По дороге выяснилось неприятное: SwiftUI .glassEffect для такой задачи не подходит вообще, публичный NSGlassEffectView даёт только половину результата, а вид, близкий к системному HUD, появляется уже после ковыряния приватного CAFilter glassBackground . Ниже — весь путь, с кодом, ошибками и местами, где я сам сначала чинил не то
https://habr.com/ru/articles/1053570/
#swift #macos #appkit #liquidglass #core_animation #реверсинжиниринг #приватные_методы #swiftui
-
Yeesh this one has been a bit of an ordeal. But now we have live previews of the symbols you're drawing, actually rendered as SF Symbols via Apple’s code.
This has involved hand crafting a .car file (via reverse engineering what all the bit patterns mean), saving to disk, then loading it back in with NSBundle to then hand to SwiftUI's Image. (This is probably the only bit of SwiftUI that'll be in the app!)
-
Yeesh this one has been a bit of an ordeal. But now we have live previews of the symbols you're drawing, actually rendered as SF Symbols via Apple’s code.
This has involved hand crafting a .car file (via reverse engineering what all the bit patterns mean), saving to disk, then loading it back in with NSBundle to then hand to SwiftUI's Image. (This is probably the only bit of SwiftUI that'll be in the app!)
-
So, when Apple deprecates NSDrawer and it doesn't support dark mode... build my own!
(Custom NSWindow as a child window, drawing my own chrome.)
-
So, when Apple deprecates NSDrawer and it doesn't support dark mode... build my own!
(Custom NSWindow as a child window, drawing my own chrome.)
-
While I'm investigating old stuff… turns out that custom bindings in the interface builder inspector still work in Xcode 26, via @IBDesignable and `exposeBinding()`!
-
While I'm investigating old stuff… turns out that custom bindings in the interface builder inspector still work in Xcode 26, via @IBDesignable and `exposeBinding()`!
-
I added new articles to gnustep-developer.com. One is about ensuring a shared object gets loaded when it only contains ObjC symbols. The other, which is more important because there aren't other good examples online, is about the structure of NeXT-style app menus that you use on platforms other than macOS: https://gnustep-developer.com/articles/menu-structure/ #gnustep #crossplatform #appkit
-
I added new articles to gnustep-developer.com. One is about ensuring a shared object gets loaded when it only contains ObjC symbols. The other, which is more important because there aren't other good examples online, is about the structure of NeXT-style app menus that you use on platforms other than macOS: https://gnustep-developer.com/articles/menu-structure/ #gnustep #crossplatform #appkit
-
As I mentioned yesterday, I have now published the minor update to macOS Apps Step by Step that adjusts for changes to the API used in the first section.
Read about the update at https://troz.net/post/2026/macos-apps-step-by-step-minor-update/ and check out a sample chapter at https://troz.net/books/mac_apps_sample
-
As I mentioned yesterday, I have now published the minor update to macOS Apps Step by Step that adjusts for changes to the API used in the first section.
Read about the update at https://troz.net/post/2026/macos-apps-step-by-step-minor-update/ and check out a sample chapter at https://troz.net/books/mac_apps_sample
-
-
-
TextKit 2 can't have multiple NSTextContainers for one layout manager!
Which… presumably means you can't do printing, or multi-column… this kind of rules it out for the app I'm building now! Guess I'm using TextKit 1 again.