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 pathContentOfSymbolicLinkAtPat

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 isEqua

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 ha

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 checkbo

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 reserve

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 sp

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 wil

Re: My private problems

2008-04-20 Thread Jean-Daniel Dupas
Le 20 avr. 08 à 10:46, stephen joseph butler a écrit : 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 trav

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 closedHandCu

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 - and

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 testStu

how to get what tells fileURL has been changed by others

2008-04-20 Thread のりちん
Hi, I'd like to know who tells NSDocument that its location has been changed by other apps and how to get the notification. I'd like to hack before you notice something like "the document's location was changed, so do you want to save any other location?" when you open the file by an app and move

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 bindin

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: NSPopupButton Bindings

2008-04-20 Thread Johnny Lundy
As follow-up, I set the bindings of the popup to be content: Array Controller.arrangedObjects content objects: not used content values: Array Controller.arrangedObjects.name When I pass the selection of the Array Controller to my method, all I get for the parameter in NSLog is victim: <_NSCo

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

2008-04-20 Thread Uli Kusterer
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++) { } Yeah, I like that, when I can use it. It's just not always possible, and

Re: NSPopupButton Bindings

2008-04-20 Thread Keary Suska
on 4/20/08 7:27 AM, [EMAIL PROTECTED] purportedly said: > When I pass the selection of the Array Controller to my method, all I > get for the parameter in NSLog is > > victim: <_NSControllerObjectProxy: 0x1059790> for the first parameter > that was passed to the method. > > and trying to log [vic

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 setObj

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 *)LSCopyApplicationURLsForURL((CFU

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: How is this possible?

2008-04-20 Thread Jean-Daniel Dupas
You should avoid to include headers from other headers whenever possible. It reduce include graph complexity and improve build time. For example, you do not have to include the ClassTwo.h to declare a ClassTwo ivar. Just tell the compiler that ClassTwo is a class (and import ClassTwo.h from

Re: How is this possible?

2008-04-20 Thread Jonathan del Strother
On Sun, Apr 20, 2008 at 4:25 PM, Don Arnel <[EMAIL PROTECTED]> wrote: > 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

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(); id

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 obje

Re: KVO and Object Arrays

2008-04-20 Thread Jake Carter
Murph, Thanks for the info. This is a really great place for me to start. :// Jake On Apr 20, 2008, at 8:56 AM, Sean Murphy wrote: 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

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 lis

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: A cursor bug in DragItemAround example

2008-04-20 Thread Quincey Morris
On Apr 20, 2008, at 03:43, Ling Wang wrote: 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 mous

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 a

Passing a C String as an argument

2008-04-20 Thread Philip Bridson
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 manipulate the string. I also could put it in C++ and it would work but I'm tryi

Re: Cocoa-dev Digest, Vol 5, Issue 648

2008-04-20 Thread Johnny Lundy
That works. I did not use the selectedObjects before because my understanding was that was for detail controllers of detail views. It is passed wrapped in a one-element NSArray, and I can extract the dictionary with objectAtIndex:0. Thanks ever so much - two days struggling with this. I was

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 man

Repost: KVO Problem with NSCollectionView

2008-04-20 Thread Joachim Deelen
Hi Again, 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 Thanks Joachim Deelen Anfang der weitergeleiteten E-Mail: Von: Joachim Deelen <[EMAIL PROTECTED]> Datum: 16. April 2008

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

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 w

Re: Binding NSButton enabled state

2008-04-20 Thread Keary Suska
on 4/20/08 11:47 AM, [EMAIL PROTECTED] purportedly said: > 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

Re: Repost: KVO Problem with NSCollectionView

2008-04-20 Thread Hamish Allan
On Sun, Apr 20, 2008 at 7:34 PM, Joachim Deelen <[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 Are you using an NSArrayController between your NSCollect

Re: drawRect: called twice for NSView subclass.

2008-04-20 Thread William Hunt
On Apr 19, 2008, at 6:28 PM, Scott Thompson wrote: On Apr 19, 2008, at 7: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

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 [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 Are you us

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

2008-04-20 Thread John Joyce
I apologize for the beginner nature of this, I must be missing something obvious, but I cannot see it. Archiving works fine. The data is there. I've inserted NSLogs everywhere to no avail. When the file is opened (unarchived) the log showed me the first object in my array has the correct data

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 be

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: Passing a C String as an argument

2008-04-20 Thread William Squires
I think he means, "how do you convert an NSString to a C-string?" But I could be wrong... :) On Apr 20, 2008, at 12:33 PM, Clark Cox wrote: 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 f

Re: NSScrollView "autoscroll" while adding data?

2008-04-20 Thread Jens Alfke
On 20 Apr '08, at 5:38 PM, Jack Repenning wrote: I confess what I actually want is a bit more complicated than always positioning at the bottom: if the user has moved the thumb about, then the user's chosen position should win; it's only if the thumb is bottomed at the moment I add the nex

Re: NSScrollView "autoscroll" while adding data?

2008-04-20 Thread Nathan Kinsinger
On Apr 20, 2008, at 8:12 PM, Jens Alfke wrote: On 20 Apr '08, at 5:38 PM, Jack Repenning wrote: I confess what I actually want is a bit more complicated than always positioning at the bottom: if the user has moved the thumb about, then the user's chosen position should win; it's only if th

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

2008-04-20 Thread Graham Cox
This is a weird one, I've been battling this for many hours now with no luck, so I hope the list can help. I have a NSTableView in which I am drawing a custom cell. The custom cell draws fine when the table is loaded and used normally - (BTW, the custom cell just draws a colour swatch). W

Re: Mounting AFP Volume using Cocoa

2008-04-20 Thread JanakiRam
Hi Bill, Thanks for your response. This code works fine , but when i try to mount a single volume/account on the same server , 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

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

2008-04-20 Thread Jens Alfke
On 20 Apr '08, at 9:33 PM, Graham Cox wrote: The problem I'm having is that when the menu is used to update the cell in the table view, I just cannot get the darn thing to redraw. At all. (at least until after the menu tracking returns and it goes away). I've tried: Remember, a table vie

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 i

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 af

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 r

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

2008-04-20 Thread Graham Cox
Great, got it working now. Thanks a lot for the lead... to be honest pulling the dataSource's strings feels a bit hackish but at least it's confined to the controller class that is the table's dataSource, so it's a unique place in my app anyway. Works a treat ;-) I also feel I understand ta

How to disable Energy Saving mode ?

2008-04-20 Thread ADIL SALEEM
Hi, In my application i have a requirement that computer does not go to 'sleep' mode while the application is running. So i want to disable energy saving mode from the application. How do i do that ? If it is not possible directly, is there any work around for this ? Thank you __

Re: How to disable Energy Saving mode ?

2008-04-20 Thread Graham Cox
OSErr UpdateSystemActivity ( UInt8 activity ); G. On 21 Apr 2008, at 4:19 pm, ADIL SALEEM wrote: Hi, In my application i have a requirement that computer does not go to 'sleep' mode while the application is running. So i want to disable energy saving mode from the application. How do i do t