Re: Implementing a Slightly Unusual NSTableView

2008-04-20 Thread Peter Zegelin
Hi Graham, This is great - worked like a charm first time. Many, many thanks! The only thing I think I need to do now is to get the TableView to become first responder when I don't click on a checkbox. I think I'm nearly there as well. What I have done is make the tableview accept

My private problems

2008-04-20 Thread Gerriet M. Denkmann
I need an absolute path. So I do: NSFileManager *fima = [ NSFileManager defaultManager ]; NSString *fileType = [ [ fima fileAttributesAtPath: path traverseLink: NO ]; fileType ]; if ( [ fileType isEqualToString: NSFileTypeSymbolicLink ] ) path = [ fima

Re: My private problems

2008-04-20 Thread stephen joseph butler
On Sun, Apr 20, 2008 at 3:19 AM, Gerriet M. Denkmann [EMAIL PROTECTED] wrote: I need an absolute path. So I do: NSFileManager *fima = [ NSFileManager defaultManager ]; NSString *fileType = [ [ fima fileAttributesAtPath: path traverseLink: NO ]; fileType ]; if ( [ fileType

Re: My private problems

2008-04-20 Thread stephen joseph butler
On Sun, Apr 20, 2008 at 3:46 AM, stephen joseph butler [EMAIL PROTECTED] wrote: You can do this: [[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:[fima pathContentOfSymbolicLinkAtPath :path]]; I think that will work. Actually, that won't. You have to write a

Re: Implementing a Slightly Unusual NSTableView

2008-04-20 Thread Graham Cox
Hi Peter, You'll note my code says nothing about first responder, so you should get whatever the table view is set to do. In my use of this code, my table view is actually in a floating window and I've set it only to become key if needed - and so for changing selection or toggling

Re: Extending NSOpenGLView leads to strange compile error...

2008-04-20 Thread Wayne Packard
What happens if you change - (tetra)init; to - (id)init; wp On Apr 20, 2008, at 2:08 AM, Spam Tron wrote: HI all - I want to be able to extend the NSOpenGLView class to have a ptr to some ptr to an NSObject class (nothing too complicated I think?). Here's the tetra.h file //Tetra.h //

Extending NSOpenGLView leads to strange compile error...

2008-04-20 Thread Spam Tron
HI all - I want to be able to extend the NSOpenGLView class to have a ptr to some ptr to an NSObject class (nothing too complicated I think?). Here's the tetra.h file //Tetra.h // // tetra.h // myogl // // Created by shockwave on 4/2/08. // Copyright 2008 __MyCompanyName__. All rights

Re: Should a Method set NSError* to nil when No Error?

2008-04-20 Thread Jean-Daniel Dupas
Le 20 avr. 08 à 01:03, Uli Kusterer a écrit : Am 19.04.2008 um 18:46 schrieb Jerry Krinock: I often write methods that take an (NSError**)error_p argument. In the documentation of Apple methods that do this, I read that the NSError** will be set if there ^is^ an error, but most do not

Re: My private problems

2008-04-20 Thread Gerriet M. Denkmann
On 20 Apr 2008, at 10:53, [EMAIL PROTECTED] wrote: On Sun, Apr 20, 2008 at 3:46 AM, stephen joseph butler [EMAIL PROTECTED] wrote: You can do this: [[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:[fima pathContentOfSymbolicLinkAtPath :path]]; I think that will

A cursor bug in DragItemAround example

2008-04-20 Thread Ling Wang
You can see the code at http://developer.apple.com/samplecode/DragItemAround/listing2.html on ADC. The bug is that the cursor reverts to arrowCursor if the item is dragged off the bound calculated at the mouseDown event just before current mouseDragged event, instead of staying

Re: Implementing a Slightly Unusual NSTableView

2008-04-20 Thread Peter Zegelin
On 20/04/2008, at 7:28 PM, Graham Cox wrote: Hi Peter, You'll note my code says nothing about first responder, so you should get whatever the table view is set to do. In my use of this code, my table view is actually in a floating window and I've set it only to become key if needed -

Complex data for webservices

2008-04-20 Thread Niklas Saers
Hi guys, I'm making a Cocoa based application that will communicate with a webservice that I've already written other applications for and works great. The server part is written in C# and uses SOAP as WS communication protocol. Now, I've made the stubs by WSMakeStubs -x ObjC -name

Fwd: NSPopupButton Bindings

2008-04-20 Thread Johnny Lundy
Thanks Steve, I have the IBAction working no problem. What I was looking to do is to use bindings, as I am trying to learn about them - I am doing this project to teach myself about MVC-compliant techniques. I have the array controller and just need to know which one of the popup's

Re: My private problems

2008-04-20 Thread Jim Correia
On Apr 20, 2008, at 6:18 AM, Gerriet M. Denkmann wrote: So - just for fun - how can I convert the symbolic link /tmp into an absolute pathname? stringByResolvingSymlinksInPath leaves it unchanged. That the /private prefix is removed is documented behavior.

Re: Implementing a Slightly Unusual NSTableView

2008-04-20 Thread Graham Cox
I just noticed a bug in the code I posted - it should be: - mouseDown: ... if ([dataCell trackMouse:event inRect:cellFrame ofView:self untilMouseUp:YES]) { // call the datasource to handle the checkbox state change as normal [[self dataSource] tableView:self

Re: Get list of possible applications

2008-04-20 Thread Gerd Knops
On Apr 19, 2008, at 11:33 PM, Chris Hanson wrote: On Apr 19, 2008, at 9:55 AM, Gerd Knops wrote: This returns an array with URLs of applicable applications for a file of a given URL: - (NSArray *)applicationsForURL:(NSURL *)url { return (NSArray

How is this possible?

2008-04-20 Thread Don Arnel
I have two different class objects that need to know about each other (see below). But if I include the header from one class inside the header of the other class the compiler complains. Is this even possible? ClassOne.h: #import ClassTwo.h @interface ClassOne : NSObject {

Re: Should a Method set NSError* to nil when No Error?

2008-04-20 Thread Clark Cox
On Sun, Apr 20, 2008 at 7:20 AM, Uli Kusterer [EMAIL PROTECTED] wrote: Am 20.04.2008 um 11:45 schrieb Jean-Daniel Dupas: I greatly prefere the C99 way to do it. It prevents variables conflict if you have more than one loop in your method. for (int idx = 0; idx maxCount(); idx++) { }

Re: KVO and Object Arrays

2008-04-20 Thread Sean Murphy
On Apr 20, 2008, at 1:13 AM, Jake Carter wrote: So the AppDelegate will contain an array of Foo object and each Foo object will have an array of Bar objects. I want to be able to observe the bars from the AppDelegate to see when new bars are added or when a property changes in each bar

Re: A cursor bug in DragItemAround example

2008-04-20 Thread Jens Alfke
On 20 Apr '08, at 3:43 AM, Ling Wang wrote: The bug is that the cursor reverts to arrowCursor if the item is dragged off the bound calculated at the mouseDown event just before current mouseDragged event, instead of staying closedHandCursor. Maybe it will be clear till you try to run it.

Re: My private problems

2008-04-20 Thread Jens Alfke
To resolve symlinks in paths, call -[NSString stringByResolvingSymlinksInPath:] This is declared in NSPathUtilities.h, which makes it easy to overlook... —Jens smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing

Re: how to get what tells fileURL has been changed by others

2008-04-20 Thread Jens Alfke
On 20 Apr '08, at 5:32 AM, のりちん wrote: I'd like to know who tells NSDocument that its location has been changed by other apps and how to get the notification. I think that internally each NSDocument instance keeps an AliasHandle pointing to the document file, and before saving resolves the

Re: Get list of possible applications

2008-04-20 Thread Daniel
Hi, thank you very much for your help, I was searching exactly that! Best regards, Daniel On Sun, Apr 20, 2008 at 5:15 PM, Gerd Knops [EMAIL PROTECTED] wrote: On Apr 19, 2008, at 11:33 PM, Chris Hanson wrote: On Apr 19, 2008, at 9:55 AM, Gerd Knops wrote: This returns an array with

Re: adding Quicklook preview to my app

2008-04-20 Thread Julien Jalon
If your document's format is a document bundle, just make sure to save your PDF preview inside your document's bundle in a folder names QuickLook. The preview should be named Preview.pdf The thumbnail should be named Thumbnail.png (or jpg, or whatever format suites you) If you can't do that, you

Re: Passing a C String as an argument

2008-04-20 Thread Clark Cox
On Sun, Apr 20, 2008 at 10:17 AM, Philip Bridson [EMAIL PROTECTED] wrote: Hi There, Is there anyway to pass a C string from a Obj-C class to a C function as an argument? I know that I can use pointers to the string but it gets a bit messy as I am using pointers in the C function to

Re: Binding NSButton enabled state

2008-04-20 Thread Lorenzo Thurman
On Sat, Apr 19, 2008 at 11:55 PM, Chris Hanson [EMAIL PROTECTED] wrote: On Apr 19, 2008, at 11:08 AM, Lorenzo Thurman wrote: I have two NSTableViews, tableA and tableB, each managed by separate NSArrayControllers. When a selection is made in either table, an instance variable is set. I

Re: drawRect: called twice for NSView subclass.

2008-04-20 Thread David Duncan
On Apr 19, 2008, at 5:15 PM, William Hunt wrote: Essentially I have a window with a custom view atop a button. What happens at each refresh, however, is that the custom view's drawRect: is called twice. First it is called with the whole window's NSRect, then it is called with the proper

Re: horizontal sizeToFit of NSTextView or NSTextField

2008-04-20 Thread Manfred Schwind
Now I want to be able to calculate the optimal width of the view so that the entire text is visible. This worked wonders for me: http://www.cocoabuilder.com/archive/message/cocoa/2008/3/31/202752 This also does not solve my problem. Getting the height of a text for a given width is easy and

Re: Passing a C String as an argument

2008-04-20 Thread Jens Alfke
On 20 Apr '08, at 10:17 AM, Philip Bridson wrote: Is there anyway to pass a C string from a Obj-C class to a C function as an argument? I know that I can use pointers to the string but it gets a bit messy as I am using pointers in the C function to manipulate the string. It sounds like

Re: Repost: KVO Problem with NSCollectionView

2008-04-20 Thread Joachim Deelen
Am 20.04.2008 um 22:08 schrieb Hamish Allan: On Sun, Apr 20, 2008 at 7:34 PM, Joachim Deelen cocoa- [EMAIL PROTECTED] wrote: does really no one have a solution or a hint for the Problem mentioned below? Maybe I'm understanding something wrong? Any help or Ideas would be appreciated

Re: horizontal sizeToFit of NSTextView or NSTextField

2008-04-20 Thread Gary L. Wade
If you wish to vary both the width and height to be a more pleasing set of dimensions, similar to what an alert does, try word wrapping your text into a golden ratio rectangle using the area measurement generated by your single-line text measurement. Of course, based on a strict interpretation

Cocoa UI Developer Needed!!!

2008-04-20 Thread Darren Tessitore
Posted: 10-Mar-08 Job reference: 08031001 Location: San Francisco area Type: Corp-to-Corp contract Length: 8 - 12 months Department: Engineering Group Reports To: Director, Client Applications General Summary: Our client is looking for an experienced Mac OS X developer, someone who can

NSScrollView autoscroll while adding data?

2008-04-20 Thread Jack Repenning
I have an NSScrollView to which I add data as the program proceeds. I would like to have it scroll itself automatically, so that the bottom (most recently added) line is always visible, instead of the top. As an example, Xcode's build transcript does what I'm after. I figured this would

Re: After Unarchive Object Exists, After First GUI Action, gone...

2008-04-20 Thread John Joyce
Looks like I found a solution... anyone please let me know if my solution stinks. (or any of the rest of this thing!) In the method - (void)windowControllerDidLoadNib:(NSWindowController *) aController I added this: [textView setString:[[stickitNotes objectAtIndex:0] noteBody]]; #import

Re: Mounting AFP Volume using Cocoa

2008-04-20 Thread Jens Alfke
On 20 Apr '08, at 9:36 PM, JanakiRam wrote: this code doesn't seem to work for mounting multiple volumes/ accounts.I'm always getting -43 error.If i unmount the earlier volume/account on the same server then i'm able to mount another volume on the same server. I don't think you can log

Re: Updating a cell in NSTableView - it just will not draw!

2008-04-20 Thread Graham Cox
Aha - I think you've hit the nail on the head. You say remember but I don't think I realised this. In this case updating the data model is not really what I want - for one thing it's quite expensive (potentially) and for another it makes more sense to set the data model on the mouse-up

Re: Updating a cell in NSTableView - it just will not draw!

2008-04-20 Thread Jens Alfke
On 20 Apr '08, at 10:40 PM, Graham Cox wrote: So the question is: is there a way to trigger the reload of just a single row? This isn't necessarily the selected row... if I just mark for update the cell rect for the row/column is NSTableView smart enough to only request the data for that