KVO and lazy loading

2008-10-21 Thread Ashley Clark
I'm pretty sure I've got this worked out and it seems to be working, BUT I thought that before and when I turned on Auto Arrange Content on my NSArrayController's this bug popped up. So I wanted to make sure I'm doing this right. I'm lazily initializing objects that are being read from a d

- (id)initWithBundle:(NSBundle *)bundle

2008-10-21 Thread Adam Penny
Hi there, In a preference pane subclass, should the above method be treated as a replacement for the init method used in normal app controllers i.e. allocating any other objects that might be needed in the controller? Thanks, Adam ___ Cocoa-dev

[JOB]: Software Engineer

2008-10-21 Thread Michael Paluszek
Software Engineer The primary task of this job is to support our VisualCommander product http://www.psatellite.com/vc/ . Candidate will help our aerospace engineers implement control systems, simulations, and displays in VisualCommander for our NASA and DoD projects. Requirements: Bachelo

Bind an NSRect

2008-10-21 Thread gMail.com
I would like to bind 4 NSTextFields with each of the 4 values of a NSRect mViewFrame. So when I change a value, my view resizes automatically. I am already able to bind the 4 float values, one by one, origins and size, but this way I have to add 4 redundant float values and write 8 methods (4 set a

Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Andy Lee
On Oct 20, 2008, at 5:07 PM, Sean McBride wrote: In 10.5, NSTableView handles many keypresses automatically: up arrow, down arrow, page up, page down, home, end, and even 'type select'. I also need to (robustly!) support the 'delete' key. I just noticed this (thanks to a reference to Opacity o

Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Dalzhim Dalzhim
Well the concept is pretty simple. When an instance of NSResponder doesn't handle a specific event, it is passed up on the responder chain. Instead of subclassing NSTableView or NSOutlineView, it is only necessary to insert a new NSResponder instance in the responder chain, after the table view o

Re: How to draw a Recessed Button Shadow

2008-10-21 Thread Dalzhim Dalzhim
Hello Rob, I have already tried the methods you mention and they draw the gray opaque background that I want to get rid of so that I can make the highlight a different color, as well as drawing the arrow images. Although the gray opaque background is the same as when you put the mouse over the fi

Toolbar buttons and isEnabled binding

2008-10-21 Thread Chris Idou
I seem to be getting erratic behaviour from toolbar button isEnabled bindings. In some scenarios they don't seem to work correctly. I've tried putting the exact same binding criteria on some regular buttons just to see what happens, and they seem to work correctly when the toolbar buttons don'

Re: Core Data saving / Leopard / The temporary directory at ...

2008-10-21 Thread chaitanya pandit
Well i'm not a core data pro. but here is what i have observed with core data. If you create an entity and delete it after saving, the deleted entity will be shown in the "[[[self managedObjectContext] deletedObjects]allObjects]" array. But if you delete the entity immediately after creation w

Re: - (id)initWithBundle:(NSBundle *)bundle

2008-10-21 Thread Nick Zitzmann
On Oct 21, 2008, at 3:59 AM, Adam Penny wrote: In a preference pane subclass, should the above method be treated as a replacement for the init method used in normal app controllers i.e. allocating any other objects that might be needed in the controller? I think so, even though it doesn

Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Corbin Dunn
On Oct 21, 2008, at 6:44 AM, Dalzhim Dalzhim wrote: Well the concept is pretty simple. When an instance of NSResponder doesn't handle a specific event, it is passed up on the responder chain. Instead of subclassing NSTableView or NSOutlineView, it is only necessary to insert a new NSRespon

Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Sean McBride
On 10/21/08 9:44 AM, Dalzhim Dalzhim said: >Well the concept is pretty simple. When an instance of NSResponder doesn't >handle a specific event, it is passed up on the responder chain. Instead of >subclassing NSTableView or NSOutlineView, it is only necessary to insert a >new NSResponder instanc

CalendarStore eventPredicateWithStartDate question

2008-10-21 Thread Dale Jensen
In attempting to read events from the CalendarStore for a specific calendar and expansive time period, I'm using: eventPredicateWithStartDate:endDate:calendars: The existance of, and documentation for, this other implementation: eventPredicateWithStartDate:endDate:UID:calendars: implies that

Putting an image on a CALayer

2008-10-21 Thread DKJ
I'd like to put an image stored in a JPEG file onto a CALayer. It seems that I do this by assigning a CGImageRef to its contents property. But how do I get a CGImageRef from a file? Do I make an NSData object from the file and do something with that? dkj ___

Re: @property and HeaderDoc

2008-10-21 Thread Sean McBride
On 10/20/08 5:38 PM, Jerry Krinock said: >Has anyone thought about making HeaderDoc support @property >declarations? Besides a new Xcode menu script to generate the >HeaderDoc comment, I believe that the HeaderDoc generator tool would >also need some code added to parse the declaration itself. I

Re: Putting an image on a CALayer

2008-10-21 Thread Alex Heinz
You could use [[NSImage alloc] initWithContentsOfFile:], and then draw the NSImage to the CALayer. HTH, Alex On Oct 21, 2008, at 11:46 AM, DKJ wrote: I'd like to put an image stored in a JPEG file onto a CALayer. It seems that I do this by assigning a CGImageRef to its contents property.

Re: Putting an image on a CALayer

2008-10-21 Thread Jean-Daniel Dupas
Le 21 oct. 08 à 17:46, DKJ a écrit : I'd like to put an image stored in a JPEG file onto a CALayer. It seems that I do this by assigning a CGImageRef to its contents property. But how do I get a CGImageRef from a file? Do I make an NSData object from the file and do something with that?

Re: Putting an image on a CALayer

2008-10-21 Thread Josh Abernathy
Scott Stevenson uses an NSImage category with: - (CGImageRef)cgImage { // I'm open to better ideas. :) NSData* data = [self TIFFRepresentation]; return CreateCGImageFromData(data); } So create an NSImage and use that. On Oct 21, 2008, at 11:46 AM, DKJ wrote: I'

Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Dalzhim Dalzhim
Well you can easily create a NSTableView category in which you handle the integration of a NSResponder which handles the delete key into the responder chain. This way you won't have to fix this in every single subclass of NSTableView that might appear in the future, wherever it comes from (system c

Re: Putting an image on a CALayer

2008-10-21 Thread DKJ
On 21 Oct, 2008, at 08:51, Alex Heinz wrote: then draw the NSImage to the CALayer This is the bit I'm not sure how to do. I see a CALayer contents property, but I can't assign an NSImage to that. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple

looking for reference to a dictionary

2008-10-21 Thread Stefan Wolfrum
Hi all, I have an array. Each array entry is a dictionary. Each dictionary has two key/value pairs (all are strings). Now I get from somewhere else the value (a string) corresponding to one of the keys. It's exactly the same string, content-wise (not address-wise). What I need: a referenc

Re: looking for reference to a dictionary

2008-10-21 Thread Alex Heinz
You can't. Iterating through the array is the only way, unless the dictionaries are organized in some special way. Out of curiosity, why not just use a single dictionary, instead of an array of dictionaries? HTH, Alex On Oct 21, 2008, at 12:08 PM, Stefan Wolfrum wrote: Hi all, I have an a

Re: looking for reference to a dictionary

2008-10-21 Thread Bill Bumgarner
On Oct 21, 2008, at 9:08 AM, Stefan Wolfrum wrote: Hi all, I have an array. Each array entry is a dictionary. Each dictionary has two key/value pairs (all are strings). Now I get from somewhere else the value (a string) corresponding to one of the keys. It's exactly the same string, conten

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

2008-10-21 Thread Gordon Apple
Uh, unless you might want to draw an NSImage sometime... On 10/20/08 9:04 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 21 Oct 2008, at 2:21 am, DKJ wrote: > >> When I do this in the controller's awakeFromNib method: >> >> [theView lockFocus]; > > > Then don't do it! > > stuff

Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Barry Wark
I'm using [NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths:inEntityDescription:] to generate predicate row templates for a Core Data entity. One of the properties is a date. Is there any way to change the NSDatePickerElementFlags for the NSDatePicker in the associated row template (to i

Re: Putting an image on a CALayer

2008-10-21 Thread glenn andreas
On Oct 21, 2008, at 10:54 AM, Josh Abernathy wrote: Scott Stevenson uses an NSImage category with: - (CGImageRef)cgImage { // I'm open to better ideas. :) NSData* data = [self TIFFRepresentation]; return CreateCGImageFromData(data); } So create an NSImage and

Automatically generated predicate row templates for to-many key?

2008-10-21 Thread Barry Wark
Continuing my adventures with NSPredicateEditor... In my Core Data managed object model, I have an entity Foo with a to-many relationship (with a to-many inverse) to entity Baz named baz. Baz has a string property named "tag". When I use [NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths

Re: How to draw a Recessed Button Shadow

2008-10-21 Thread Kyle Sluder
On Tue, Oct 21, 2008 at 9:55 AM, Dalzhim Dalzhim <[EMAIL PROTECTED]> wrote: > I have already tried the methods you mention and they draw the gray opaque > background that I want to get rid of so that I can make the highlight a > different color, as well as drawing the arrow images. So subclass NSP

Re: Putting an image on a CALayer

2008-10-21 Thread David Duncan
On Oct 21, 2008, at 8:50 AM, Jean-Daniel Dupas wrote: I'd like to put an image stored in a JPEG file onto a CALayer. It seems that I do this by assigning a CGImageRef to its contents property. But how do I get a CGImageRef from a file? Do I make an NSData object from the file and do someth

Re: Starting a drag in mouseDragged

2008-10-21 Thread James Walker
James Walker wrote: The documentation on -[NSView dragImage:at:offset:event:pasteboard:source:slideBack:] says that you can invoke it either in mouseDown or mouseDragged. It makes more sense to me to call it from mouseDragged, since in most cases mouseDown will just indicate a click. However

Problems when putting a window between desktop and desktop icons

2008-10-21 Thread Markus Amalthea Magnuson
Hello, I am trying to put a window above the desktop but below the desktop icons. I have achieved this by using the following code (in my own subclass of NSWindow): [self setLevel:kCGDesktopIconWindowLevel - 1]; I can see that it at least visually works by using: [self setBackgroundColor:[NSCol

Data structure suggestions

2008-10-21 Thread Andre Masse
Hi all, I'm currently implementing front-end to create a sql query for a PostgreSQL database. I have: - a popup (tableMenu) menu containing the database' tables which is populated the database (from pg_tables) - a combobox (fieldsList), datasource is an array of "query-able" fields. I'

Strange Tiger incompatability

2008-10-21 Thread David Burnett
Hi, I've got an issue with a Universal App targeting Tiger and above. No Leopard the application works fine, but on Tiger I get this error... 2008-10-20 19:49:59.089 Oxidizer[389] An uncaught exception was raised 2008-10-20 19:49:59.089 Oxidizer[389] Cannot find value transformer with name Im

Re: Core Data saving / Leopard / The temporary directory at ...

2008-10-21 Thread Jonathan Freeman
Thanks Chaitanya, This sent me on the right path. I had implemented a custom remove on the children and was calling the MOC -deleteObject method to remove a child from MOC. The docs say this on the deletedObjects method: Discussion Note that the returned set does not necessarily include all t

keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley
Hi all, Tried searching for answers to this and haven't come up with anything yet... I'm displaying a sheet which has a default button. The default button dismisses the sheet. When the user presses Return to dismiss the sheet via the default button, the keyUp event for the Return key is s

Re: Strange Tiger incompatability

2008-10-21 Thread Kyle Sluder
On Tue, Oct 21, 2008 at 3:09 PM, David Burnett <[EMAIL PROTECTED]> wrote: > Does any one have any ideas what I might be doing wrong. You haven't called +[NSValueTransformer setValueTransfomer:forName:]. Re-read the Value Transformer Progamming Guide: http://developer.apple.com/documentation/Cocoa/

Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Kyle Sluder
On Tue, Oct 21, 2008 at 1:43 PM, Ken Worley <[EMAIL PROTECTED]> wrote: > It seems like the correct solution is to somehow avoid the keyUp being sent > to the window/edit field after the sheet is dismissed, but I also wonder if > I'm catching the right event in the edit field. Have you read the Tex

Re: Putting an image on a CALayer

2008-10-21 Thread DKJ
OK, I tried this: NSURL *url = [NSURL fileURLWithPath:fname]; CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url, NULL); CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL); CFRelease(source); theView.layer.contents = image; an

Re: Putting an image on a CALayer

2008-10-21 Thread douglas welton
On Oct 21, 2008, at 4:00 PM, DKJ wrote: OK, I tried this: NSURL *url = [NSURL fileURLWithPath:fname]; CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url, NULL); CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL); CFRelease(source);

Re: Putting an image on a CALayer

2008-10-21 Thread glenn andreas
On Oct 21, 2008, at 3:13 PM, douglas welton wrote: On Oct 21, 2008, at 4:00 PM, DKJ wrote: OK, I tried this: NSURL *url = [NSURL fileURLWithPath:fname]; CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url, NULL); CGImageRef image = CGImageSourceCreateImageAtIndex(

Re: Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Peter Ammon
On Oct 21, 2008, at 9:35 AM, Barry Wark wrote: I'm using [NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths:inEntityDescription:] to generate predicate row templates for a Core Data entity. One of the properties is a date. Is there any way to change the NSDatePickerElementFlags for th

Re: Problems when putting a window between desktop and desktop icons

2008-10-21 Thread Charles Steinman
--- On Tue, 10/21/08, Markus Amalthea Magnuson <[EMAIL PROTECTED]> wrote: > This half transparent red color covers the desktop, but not > the > desktop icons. So far, so good. The problem however, is > that my window > intercepts all mouse clicks, even if I click on an icon. Does [window setIgnor

Re: Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Ashley Clark
On Oct 21, 2008, at 3:45 PM, Peter Ammon wrote: On Oct 21, 2008, at 9:35 AM, Barry Wark wrote: I'm using [NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths:inEntityDescription:] to generate predicate row templates for a Core Data entity. One of the properties is a date. Is there any

Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley
On Oct 21, 2008, at 1:36 PM, Kyle Sluder wrote: On Tue, Oct 21, 2008 at 1:43 PM, Ken Worley <[EMAIL PROTECTED]> wrote: It seems like the correct solution is to somehow avoid the keyUp being sent to the window/edit field after the sheet is dismissed, but I also wonder if I'm catching the r

Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Kyle Sluder
On Tue, Oct 21, 2008 at 5:35 PM, Ken Worley <[EMAIL PROTECTED]> wrote: > This, by the way, is a constant source of confusion for me in Cocoa. Why is > a delegate method specific to NSTextView listed under NSControl which is the > parent class? You seem to be misunderstanding a bit. The field edit

Re: Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Peter Ammon
On Oct 21, 2008, at 2:21 PM, Ashley Clark wrote: On Oct 21, 2008, at 3:45 PM, Peter Ammon wrote: On Oct 21, 2008, at 9:35 AM, Barry Wark wrote: I'm using [NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths:inEntityDescription:] to generate predicate row templates for a Core Data en

[Q] Size of the resize box on a window

2008-10-21 Thread Eric Gorr
Is it possible to determine the size of the resize box on a window? The reason why this is important is that I need to be able to create a window programmatically and add stuff to it. In order to make sure that what I am adding does not overlap with the resize box in the lower right corner

Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley
On Oct 21, 2008, at 3:20 PM, Ken Worley wrote: On Oct 21, 2008, at 1:36 PM, Kyle Sluder wrote: On Tue, Oct 21, 2008 at 1:43 PM, Ken Worley <[EMAIL PROTECTED]> wrote: It seems like the correct solution is to somehow avoid the keyUp being sent to the window/edit field after the sheet is dis

Re: [Q] Size of the resize box on a window

2008-10-21 Thread Charles Steinman
--- On Tue, 10/21/08, Eric Gorr <[EMAIL PROTECTED]> wrote: > Is it possible to determine the size of the resize box on a > window? I'd think it can be safely expressed as NSMakeSize([NSScroller scrollerWidth], [NSScroller scrollerWidth]). Cheers, Chuck _

Re: Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Barry Wark
On Tue, Oct 21, 2008 at 3:18 PM, Peter Ammon <[EMAIL PROTECTED]> wrote: > > On Oct 21, 2008, at 2:21 PM, Ashley Clark wrote: > >> On Oct 21, 2008, at 3:45 PM, Peter Ammon wrote: >> >>> On Oct 21, 2008, at 9:35 AM, Barry Wark wrote: >>> I'm using [NSPredicateRowEditorTemplate templatesWith

Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley
On Oct 21, 2008, at 4:17 PM, Ken Worley wrote: On Oct 21, 2008, at 4:03 PM, Kyle Sluder wrote: On Tue, Oct 21, 2008 at 5:35 PM, Ken Worley <[EMAIL PROTECTED]> wrote: This, by the way, is a constant source of confusion for me in Cocoa. Why is a delegate method specific to NSTextView listed

NSInMemoryStoreType: Not really "persistent", is it?

2008-10-21 Thread Jerry Krinock
An NSPersistentStore created with NSInMemoryStoreType is in volatile RAM or VM, and is therefore not what I would call "persistent". So, why is it an NS^Persistent^Store? My guess is that NSInMemoryStoreType was added too late in the development of Core Data to change the names of the NS__

Re: Toolbar buttons and isEnabled binding

2008-10-21 Thread Chris Idou
"You can try to disable Autovalidates." I've done that, to no avail. What does that option do anyway? --- On Tue, 10/21/08, Ömer Kardaş <[EMAIL PROTECTED]> wrote: > From: Ömer Kardaş <[EMAIL PROTECTED]> > Subject: Re: Toolbar buttons and isEnabled binding > To: [EMAIL PROTECTED] > Date: Tuesd

Re: NSInMemoryStoreType: Not really "persistent", is it?

2008-10-21 Thread Bill Bumgarner
On Oct 21, 2008, at 4:43 PM, Jerry Krinock wrote: An NSPersistentStore created with NSInMemoryStoreType is in volatile RAM or VM, and is therefore not what I would call "persistent". So, why is it an NS^Persistent^Store? My guess is that NSInMemoryStoreType was added too late in the devel

Re: Toolbar buttons and isEnabled binding

2008-10-21 Thread Nick Zitzmann
On Oct 21, 2008, at 5:49 PM, Chris Idou wrote: "You can try to disable Autovalidates." I've done that, to no avail. What does that option do anyway? Normally toolbar item validation is not done through bindings, but is done through the -validateToolbarItem: method in the toolbar items'

Re: Putting an image on a CALayer

2008-10-21 Thread DKJ
Me again. I've been using this code: NSURL *url = [NSURL fileURLWithPath:fname]; CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url, NULL); CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL); CFRelease(source); theView.layer.co

Re: @property and HeaderDoc

2008-10-21 Thread Jerry Krinock
On 2008 Oct, 21, at 8:48, Sean McBride wrote: It is my impression that few people are still using HeaderDoc. doxygen supports Obj-C 2 @property declarations. Thank you, Sean. That explains it. Yes, I just downloaded Doxygen an hour ago and after running it on my project already I can s

Re: stringWithFormat

2008-10-21 Thread Kyle Sluder
On Mon, Oct 20, 2008 at 3:25 AM, Ron Green <[EMAIL PROTECTED]> wrote: > stringWithFormat: returns an NSString that is autoreleased. I know this > because I read it in Hillegasses book. But since this does not seem to be > covered in the documentation, if I had not read it in a book, how would I > d

How to prompt for admin rights in Cocoa-Python?

2008-10-21 Thread Bill Janssen
I'm writing a little uninstaller app in Cocoa-Python, and I need to put up that ubiquitous OS X prompt for the admin password, then elevate the privileges of the script to remove some directories installed as root. Is that a standard widget? If so, what is it? If not, what's the standard dance to

Re: How to prompt for admin rights in Cocoa-Python?

2008-10-21 Thread Jason Coco
On Oct 21, 2008, at 22:13 , Bill Janssen wrote: I'm writing a little uninstaller app in Cocoa-Python, and I need to put up that ubiquitous OS X prompt for the admin password, then elevate the privileges of the script to remove some directories installed as root. Is that a standard widget?

Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley
On Oct 21, 2008, at 4:03 PM, Kyle Sluder wrote: On Tue, Oct 21, 2008 at 5:35 PM, Ken Worley <[EMAIL PROTECTED]> wrote: This, by the way, is a constant source of confusion for me in Cocoa. Why is a delegate method specific to NSTextView listed under NSControl which is the parent class? Y

When does Cocoa fall apart? (Run loops)

2008-10-21 Thread Chris Idou
I noticed with the below discussed isEnabled bindings problem that if I do: [objectController performSelectorOnMainThread:@selector(setContent:) withObject:title waitUntilDone:NO]; instead of. [objectController setContent:title]; then it seems to start behaving better. I think I've notic

Re: looking for reference to a dictionary

2008-10-21 Thread Ken Thomases
On Oct 21, 2008, at 11:08 AM, Stefan Wolfrum wrote: I have an array. Each array entry is a dictionary. Each dictionary has two key/value pairs (all are strings). Now I get from somewhere else the value (a string) corresponding to one of the keys. It's exactly the same string, content-wise (