I have a window with some content that could be previewed, mailed,...
I decided that the best way to do this is to put appropriate application icons in toolbar, namely from Mail, Preview,...
Trick is, how to do that? Is thee any way too access other's application package and have access to its icon? Or is there any other elegant way?
Code:
// Get icon
NSImage *theIcon = [[NSWorkspace sharedWorkspace] iconForFile:#"/Applications/Mail.app"];
// Display icon (irrelevant in your case)
[theIcon setSize:NSMakeSize(128, 128)];
[theImageView setImage:theIcon];
There is also one other way of doing it, especially if you are building toolbar in IB:
right-click application icon
copy it
open Preview
select New from Clipboard
You will get complete set of application icons in any size. You can export them and put them in Image Well in IB
Related
Does anybody know, how to change the appearance of the title bar and/or toolbar of a simple & small one-window cocoa macOS application without accessing the Xcode or installing third party applications? It's for a screen recording video project, I want to do.
I know, that there are possibilities within the applications info.plist (for example changing the app title inside the top macOS Menu Bar) but I would like to be able to change the apps window title itself and/or colors and/or fonts inside the window title bar or toolbar if possible.
Opening the app in another container window or via terminal or Applescript and adding custom parameters or even an overlay in the right position to change the styling would be okay if this is possible?
Can somebody point me in the right direction?
Thank you very much!
in short: Nibs
Nib File Viewer works until Xcode 10
saving, recompiling if possible
good luck
I want to create a button with the icon like UIBarButtonSystemItemAction style, how can I use the icon of the UIBarButtonItem icons,
what is the name of it? Or is there some system URL is for it?
I have icon overlays working in Finder using mac_inject through the drawImage: method of the class IKImageBrowserCell (I also have the various list views working).
When Finder is switched into Arrange By Kind (or anything other than Arrange By Name) then the icon overlays no longer work.
Has anybody figured out what class needs to be used for these other views? I've been experimenting for days with no luck.
If your question is still actual, there are perfect tool called liferay-nativity hosted in github. It's cross platform, open source tool for adding icon overlay. It works with Finder very well.
https://github.com/liferay/liferay-nativity
I have an NSButton in a nib that is set to an icon, and only an icon:
When I run the app, the icon, despite being one of the images provided by AppKit, is missing:
What's going on here? Why isn't my button's icon showing up?
Okay. In my little sample app I just created, I was able to get the icon to appear (took a bit of doing, though). Summed up, you need to change the button type to "Bevel" and increase the height if necessary.
Apparently "Push"-style NSButton types are too narrow to display the icon comfortably.
Does anyone know where the icons in the Finder sidebar are located? I'd like to use that small resolution optimized Applications icon in my app, but I can't find the original anywhere.
If you want to use the icon in your source code you can get the NSImage by calling:
[[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode(kToolbarApplicationsFolderIcon)]
You can change to kToolbar{theIcon} for getting any other icon that appears on the toolbar.
Found it.
/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/SidebarApplicationsFolder.icns