cocoa

drawing NSImage tiles

how do i draw an NSImage into a view in a manner that it is tiled in a single line (there are no incomplete images drawn, and assuming that the image height is equal to the view's height)? ...

Making all Links in a Web View open in the Default Browser.

I have a web view that displays a web page but I want all links on that page to open in the default browser. How would I do this? ...

NSWindow move CGRect

Hello, what do i have to do, to get the LIVE-Change of the CGRect during movement of the NSWindow. (not before and not after, just LIVE-movement). Do I have to overwrite setFrame method? Thank you ...

run WPS from inside a cocoa application

Hi I'm trying to learn to develop in cocoa and objective C. I would like to run a run WPS from inside a cocoa application. This command works from a terminal: wps test.sas The command creates a test.log and a test.lst. How do I execute this command from the C program Is there a way to read the test.lst file into a text window in app...

How can I make building an Xcode target depend on a shell script?

I have a shell script that runs as part of a Run Script phase in my targets that conditionally copies some files into the product. If I modify the shell script then rebuild, the script is not run because the target does not know that there is a dependency there. How can I add a dependency so that modifications to the shell script cause ...

display text with many clickable URLs

Hi, I'm using custom NSCell in NSTableView similar to: http://www.martinkahr.com/2007/05/04/nscell-image-and-text-sample/ I wish to display text with many clickable URL. can any body throw me in tight direction? I was trying to do something like: http://snippets.aktagon.com/snippets/358-How-to-make-a-clickable-link-inside-a-NSTextF...

Programatically instantiating a NSPopUpButtonCell in Cocoa OSX

I have an openGL GUI interface and I need to have a popup menu that will be called when this a certain button is pressed in my openGL display. I want to display a menu similar to the one that pops up when you press an NSPopUPButton but I cannot use the Cocoa button itself. It seems that the best way to accomplish this is to use the NSP...

What class to subclass - NSView or NSButton

I am creating a button and should I subclass NSView and or NSButton? ...

Changing the fill to a already drawn NSBezierPath

I'd like to change the fill of a button that I've drawn (I subclassed NSButton) Here's the code I've got already: - (void)drawRect:(NSRect)dirtyRect { // Drawing code here. // Create the Gradient NSGradient *fillGradient = [[NSGradient alloc] initWithStartingColor:[NSColor lightGrayColor] endingColor:[NSColor darkGrayColor]]; // Creat...

Preserving data while expanding/merging Core Data models

Two separate but related questions regarding the use of Core Data: 1) I add an entity/attribute/relationship to my Core Data model in Xcode. Is there a way to have it recognize the information in the existing storedata file and augment it, instead of simply saying that it is incompatible with the existing model? For example, if I have...

Making a table's display dependent on the selection in another table in Interface Builder

I've got a window set up with two NSTableViews. In Core Data I have two entities set up, one of them containing members of the other, larger grouping (e.g. cars and manufacturers). I've got entry pages set up for each entity and they play nicely there (no faulting when trying to select from a many-to-one in a drop menu). What I'm tryi...

Closing a document's window and opening a new one, without closing the document

My app is document-based, but the “document” consists of two folders, not one file. The document's initial window contains a couple of file pickers and a button; the action closes that window and opens a new one showing the results of the operation between the two folder hierarchies. (The two windows are significantly different in size; ...

Input in menu item?

Hi! I would like to know if it is possible to have a NSTextField (for example) as a menu item in a menu. Your help will be very appreciated! Sweet day, —Albé ...

Testing file existence using NSURL

Snow Leopard introduced many new methods to use NSURL objects to refer to files, not pathnames or Core Services' FSRefs. However, there's one task I can't find a URL-based method for: Testing whether a file exists. I'm looking for a URL-based version of -[NSFileManager fileExistsAtPath:]. Like that method, it should return YES if the UR...

Image from WebView dragged onto IKImageView

I have WebView where I load content of webarchive. In the same view I have IKImageView outlet. Image drag n drop from web view onto image view doesn't work for me. What is weird, it works when I drag photo e.g. from iPhoto onto the same image view. Also, I can drag image from my web view onto NSScrollView (which creates a link to the im...

How to create a Finder alias in an application

What is the code necessary to create a Finder alias from a Cocoa application? Are there any differences between that code in Mac OS 10.4, 10.5, and 10.6? ...

Creating a ZIP archive from a Cocoa application

Are there Objective-C classes that are equivalent to the ones contained in the Java package java.util.zip? Is to execute a CLI command the only alternative? ...

How do stop panels from becomming key window on launch?

I have a xib file with a main window and a panel. On awakeFromNib I try to orderFront the main window, but the panel keeps being key window. - (void)awakeFromNib { [inspectionPanelOutlet orderBack:self]; [inspectionPanelOutlet orderWindow:NSWindowBelow relativeTo:0]; [window makeKeyAndOrderFront:self]; } This code has no effect. ...

IKImageView zooming controlled by an NSSlider.

What's the best practice for setting zoom factor of an image within IKImageView via NSSlider? I was able to bind a slider either to zoom in OR zoom out action of an IKImageView. Obviously, what I'd rather see is a single slider controlling both those actions. Best, if image is refreshed after each change of the slider (continuously, eve...

Selecting A Row In An NSTableView Programatically.

I want to Select A Row in my table view programatically, I believe I would use selectRowIndexes:byExtendingSelection: (is this a delegate method?). The other thing is how would I use that method to select the second row (in programming terms row 1)? ...