Re: Constructive Criticism

2009-10-07 Thread Jonathan Dann
- (id) init { if(self == [super init]){ Year = 0; orignalYear = 0; } return (self); } In addition to the other comments regarding calling super, you don't need to initialize instance variables to values like 0, 0.0, NO, nil,

Re: dynamic NSPointArray allocation

2009-12-01 Thread Jonathan Dann
Just use NSPointerArray: @implementation NSPointerFunctions (Additions) static NSUInteger _PointerFunctionsCGPointStructSize(const void *item) { return sizeof(CGPoint); } + (NSPointerFunctions *)pointerFunctionsForCGPoint; { NSPointerFunctions *aPointerFunctions = [NSPointerFunct

Re: Making NSTextView not wrap lines

2009-07-30 Thread Jonathan Dann
From the archives: http://www.cocoabuilder.com/archive/message/cocoa/2008/5/23/207981 On 28 Jul 2009, at 18:11, Peter Mulholland wrote: Hello cocoa-dev, Basically, i'm trying to do a little debug console. I'm using the NSTextView in NSScrollView from Interface Builder. I've got a Print me

Re: Newbie query re multithreading

2009-08-18 Thread Jonathan Dann
FWIW you can't always be sure that NSOperationQueue will be using a thread per operation. The number of active operations (I explicitly don't say "threads" here) depends on system contention. Are your operations dependent on each other or using shared resources? Are you setting -[NSOperat

Cocoa Text System - Temporarily Disabling Layout

2010-09-23 Thread Jonathan Dann
Hi all, In our app, Kaleidoscope, I have 2 text views side-by-side. In one configuration the layout of the text in each text view is dependent both on regions of layout in the "sibling" text view, and the model objects which represent the the insert, equal and deleted regions of the diff. The

Re: cool way to call super?

2010-09-23 Thread Jonathan Dann
On 23 Sep 2010, at 16:45, Matt Neuburg wrote: > Is there a cool dynamic Cocoa way to call super with the same parameters > that came to me? I guess what I'm looking for is a pre-configured invocation > of the current command where I can just change the target to super. No big > deal, but I just w

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-24 Thread Jonathan Dann
On 23 Sep 2010, at 23:12, Ross Carter wrote: > Maybe, to disable layout, set the textview's textContainer to nil, then > restore it to enable layout? Hi Ross, I'll give it a go. I think tricks like that may help in some of the cases I have. Thanks, Jon _

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-24 Thread Jonathan Dann
On 23 Sep 2010, at 23:46, Martin Wierschin wrote: >>> The problem I've had to continuously hack around is that NSTextView, in >>> conjunction with NSLayoutManager, is rather eager to get the text to >>> re-layout. >> >> Maybe, to disable layout, set the textview's textContainer to nil, then >

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-26 Thread Jonathan Dann
On 24 Sep 2010, at 18:13, Ross Carter wrote: > >> Yeah I have line numbers views set up in all of this too, for which I have >> to set the width before I set the strings of the text views so you don't see >> the views resizing on first load if the line numbers aren't wide enough to >> accommo

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-26 Thread Jonathan Dann
On 24 Sep 2010, at 19:59, Martin Wierschin wrote: > when I resize the window and need to adjust the frames of both scroll > views, calling -[NSTextView setFrame:] results in the layout manager > invalidating and ensuring layout for the newly visible character range. >>> >>> Why not

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-26 Thread Jonathan Dann
On 25 Sep 2010, at 01:23, Douglas Davidson wrote: > > On Sep 23, 2010, at 7:54 AM, Jonathan Dann wrote: > >> In our app, Kaleidoscope, I have 2 text views side-by-side. In one >> configuration the layout of the text in each text view is dependent both on >> region

Re: NSTreeController problems

2008-05-18 Thread Jonathan Dann
On 18 May 2008, at 20:57, Charles Srstka wrote: Lately, I've been trying to update my stodgy old ways and try to incorporate some of the new technologies Cocoa has picked up over the years when starting new projects (my main app has had to be compatible with older OS X versions, so I haven

Re: releasing NSKeyedUnarchiver causes crash

2008-05-18 Thread Jonathan Dann
On 18 May 2008, at 18:04, Markus Spoettl wrote: On May 18, 2008, at 5:25 AM, Klaus Backert wrote: - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { *outError = nil; NSKeyedUnarchiver *archiver; archiver = [[NSKeyedUnarchiver alloc] initForRead

Re: NSTreeController problems

2008-05-18 Thread Jonathan Dann
On 18 May 2008, at 21:57, Charles Srstka wrote: Thanks, that looks very useful. I only have one trepidation about it, which concerns this: On May 18, 2008, at 3:33 PM, Jonathan Dann wrote: - (NSArray *)rootNodes; { return [[self arrangedObjects] childNodes]; } Isn&#

Re: NSTreeController problems

2008-05-18 Thread Jonathan Dann
On 18 May 2008, at 23:57, Charles Srstka wrote: On May 18, 2008, at 5:47 PM, Jonathan Dann wrote: Not any more, the documentation may not have been updated yet. The header for NSTreeController says differently as of 10.5. It's always good to check the docs and the comments in the h

Re: Programmatically get treecontroller selection

2008-05-19 Thread Jonathan Dann
On 19 May 2008, at 13:29, Steven Hamilton wrote: I have a core data master-detail interface that consists of a sourcelist on the left and a tableview. The source list displays object from a core data entity. THe table view will be populated by a custom datasource as I have to do some dat

[OT] Wales/South West NSCoder Night (UK)

2008-05-19 Thread Jonathan Dann
Hi Guys, In follow-up to the last open invite I've had a couple of responses to starting an NSCoder night. The proposed location is to vary between Cardiff and Bristol, is anyone from the surrounding areas interested? Please contact me off-list. Look forward to hearing from you. Jon

Re: Programmatically get treecontroller selection

2008-05-20 Thread Jonathan Dann
2008-05-19 22:25:46.990 moolahcoredata[664:10b] Cannot perform operation without a managed object context I just tried to replicate this and got this error when the tree controller wasn't bound to the moc and 'prepares content' is selected. This, of course, would fail as the controller i

Re: Programmatically get treecontroller selection

2008-05-20 Thread Jonathan Dann
In addition: So, I guess my question is: how is your NSOutlineView populated? Do you have to NSTableColumn of the NSOutlineView bound to the tree controllers @"arrangedObjects.name" keypath? If this is the case, in what way are you giving the tree controller content to work with. All the

Re: Programmatically get treecontroller selection

2008-05-21 Thread Jonathan Dann
- (void)getSelectedAccount{ NSString *accountName = @"Bank"; NSLog(accountName); accountName = [[MLoutlineViewController selection] valueForKey:@"name"]; NSLog(accountName); //get managedObjectContext in preparation for fetch code moc

Core Data, transient properties and saving

2008-05-23 Thread Jonathan Dann
Hi Guys, Has anyone come across this before? I've looked online and I think I know the problem but the solution is evading me! I have an NSManagedObject that represents a text file, the text itself is saved to a text file and the file's attributes are stored in the persistent store (much

Re: NSTextView without word wrap?

2008-05-23 Thread Jonathan Dann
Its in SMLViewMenuController.m line -(IBAction)lineWrapTextAction: Jon On 23 May 2008, at 22:58, David Carlisle wrote: Looks interesting. Thanks. DC On May 23, 2008, at 3:37 PM, Jonathan Dann wrote: You may also like to look at the source code to Smultron by Peter Borg. It's in

Re: Core Data, transient properties and saving

2008-05-23 Thread Jonathan Dann
Thanks for the quick reply Ben and your explanation of what's going on. I've just re-read the Fetching section of the Core Data Programming Guide and its glaring at me not to fetch using transient attributes. I appreciate your help. Jon On 23 May 2008, at 22:32, Ben Trumbull wrote: As a s

Re: NSTextView without word wrap?

2008-05-24 Thread Jonathan Dann
[[textView textContainer] setWidthTracksTextView:NO]; [textView setHorizontallyResizable:YES]; } Thanks, DC On May 23, 2008, at 4:08 PM, Jonathan Dann wrote: Its in SMLViewMenuController.m line -(IBAction)lineWrapTextAction: Jon On 23 May 2008, at 22:58, David Carlisle wrote: Looks interestin

Re: NSFileManager's errors in 10.5, where are they documented?

2008-05-28 Thread Jonathan Dann
Thanks Jens and Ali, I appreciate your time. On 26 May 2008, at 20:15, Ali Ozer wrote: In general Cocoa classes, including NSFileManager, return errors just in the domain NSCocoaErrorDomain. So all the possible errors should be listed in FoundationErrors.h. However, there may of course b

Re: Finding the largest value in an NSTreeController?

2008-05-31 Thread Jonathan Dann
To get all the nodes in the tree I do a depth-first search (10.5 only). Add the first method in an NSTreeNode category and the second to a category on NSTreeController. // NSTreeNode_Extensions - (NSArray *)descendants; { NSMutableArray *array = [NSMutableArray array]; for (N

Possible Bug in NSFileManager -moveItemAtPath:toPath:error:

2008-05-31 Thread Jonathan Dann
Hi Guys, Just a quick one. I would expect renaming a file named HELLO.TXT to hello.txt (or another variant where the case of a few letters change) with -moveItemAtPath:toPath:error: to be allowed. As it is not (it generates an NSFileWriteUnknownError) is this a bug or just me? If not,

Re: Finding the largest value in an NSTreeController?

2008-05-31 Thread Jonathan Dann
On 31 May 2008, at 19:47, Rick Mann wrote: Jonathan, thank you for the excellent example on working with the containers. That will certainly be useful. You're welcome, but I apologise, I forgot the -rootNodes method that one of the tree controller methods I sent you calls! This method

Re: Opening column for edit after adding to tree controller?

2008-05-31 Thread Jonathan Dann
The problem is, I don't know how to determine to which row that newly-added object corresponds in the table view. Is there any way? I suppose it's the current-selected row, since it's set up to select on add. Is there a more elegant way to find out, though (i.e., what if adding didn't cha

Re: Finding the largest value in an NSTreeController?

2008-05-31 Thread Jonathan Dann
On 31 May 2008, at 21:43, Rick Mann wrote: Can category methods act as KVC properties? Yep, the -flattenedObjects method I gave you asks the array of tree nodes valueForKey:@"descendants". -descendants was the NSTreeNode method I posted. Jon smime.p7s Description: S/MIME cryptograph

Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:

2008-05-31 Thread Jonathan Dann
On 31 May 2008, at 17:37, Torsten Curdt wrote: On May 31, 2008, at 18:27, Jonathan Dann wrote: Hi Guys, Just a quick one. I would expect renaming a file named HELLO.TXT to hello.txt (or another variant where the case of a few letters change) with -moveItemAtPath:toPath:error: to be

Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:

2008-05-31 Thread Jonathan Dann
On 31 May 2008, at 18:17, Jens Alfke wrote: On 31 May '08, at 9:27 AM, Jonathan Dann wrote: Just a quick one. I would expect renaming a file named HELLO.TXT to hello.txt (or another variant where the case of a few letters change) with -moveItemAtPath:toPath:error: to be allowed.

Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:

2008-05-31 Thread Jonathan Dann
On 31 May 2008, at 22:51, stephen joseph butler wrote: On Sat, May 31, 2008 at 4:35 PM, Jonathan Dann <[EMAIL PROTECTED]> wrote: On 31 May 2008, at 18:17, Jens Alfke wrote: Try using the system call "rename". (Use "man 2 rename" to see the documentation.) Call -f

Re: invoking quicklook via code

2008-06-04 Thread Jonathan Dann
Is it possible to somehow just launch the quicklook window for a quicktime file? The quicklook framework is private and therefore should cannot be reliably used in an app. There are a few site out there that give example code that calls it though. You could use NSWorkspace to bring forwar

Re: invoking quicklook via code

2008-06-04 Thread Jonathan Dann
On 4 Jun 2008, at 23:18, Nick Zitzmann wrote: On Jun 4, 2008, at 3:48 PM, Jonathan Dann wrote: The quicklook framework is private and therefore should cannot be reliably used in an app. There are a few site out there that give example code that calls it though. Since when was this

Re: Newbie question:IB, NSView, NSViewController

2008-06-05 Thread Jonathan Dann
On 5 Jun 2008, at 14:46, Johnny Andersson wrote: To understand what I have problems with, let's suppose that I want to put a "module" consisting of an NSViewController, controlling the view with two buttons, which in turn contains a DrawView, on my main window. Do I put my DrawViewControl

NSSlider responding to superview's drawRect

2008-06-10 Thread Jonathan Dann
Hi All, This is something that I haven't seen before. I have a custom view that inherits from NSView directly and just draws a gradient background. In IB I've placed an NSSlider on the view which works fine. The problem comes when drawRect in my custom view is invoked, I draw the gradient

Re: NSSlider responding to superview's drawRect

2008-06-10 Thread Jonathan Dann
On 10 Jun 2008, at 17:05, Ken Ferry wrote: You're probably filling your gradient into the rect passed in drawRect. That rectangle just represents the dirty part of your view. If you had a solid color to draw, you could just fill the rect, but with a gradient you will get your gradient, t

Passing CGImageSourceRef to IKImageView

2008-06-16 Thread Jonathan Dann
Hi Guys, I was just looking at passing a CGImageSourceRef to an IKImageView, the documentation says you can, but there's not method that accepts it as a parameter. Is this just a feature that isn't present in the release? Are there release notes that this would be in as Image Kit isn't

Re: Passing CGImageSourceRef to IKImageView

2008-06-18 Thread Jonathan Dann
hing funky and I can't find the reference for you. On Jun 16, 2008, at 7:05 AM, Jonathan Dann wrote: Hi Guys, I was just looking at passing a CGImageSourceRef to an IKImageView, the documentation says you can, but there's not method that accepts it as a parameter. Is this just

Re: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)

2008-06-26 Thread Jonathan Dann
Here's what I do: @"isExpanded" is a persistent attribute of my model objects. In the delegate - (void)outlineViewItemDidExpand:(NSNotification *)notification; { notification userInfo] valueForKey:@"NSObject"] representedObject] setValue:[NSNumber numberWithBool:YES] forKey:@"isExpande

Re: Widgets for HUD

2008-06-29 Thread Jonathan Dann
On 27 Jun 2008, at 20:48, Erik Verbruggen wrote: I know this has been asked before on this list (somewhere earlier this year), but I couldn't find the posting back. So sorry for repeating the question, but I'd like to use the HUD of Leopard and with "fitting" widgets. Somebody mentioned so

Re: Responder Chain and NSViewController in non-doc applications

2008-06-30 Thread Jonathan Dann
n the chain you have some flexibility. Thanks for reading the articles, Jonathan Dann www.espresso-served-here.com smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin reque

Re: Mini Popup Window (Like iCal)

2008-07-11 Thread Jonathan Dann
On 10 Jul 2008, at 19:33, Seth Willits wrote: Has anyone created a custom window like the event info editor in iCal in 10.5? There's a few things I'm not sure how to do: 1) Drawing the window background gradient is pretty straightforward, but creating the thin border on the window is not

Re: NSViewController and View Swapping

2008-07-14 Thread Jonathan Dann
NSView has a method -replaceSubview:with: see: http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html#/ /apple_ref/occ/instm/NSView/replaceSubview:with: So you need to have some setup where you can keep track of you view controllers

Re: Rounded NSWindow corners?

2008-07-14 Thread Jonathan Dann
Have a look and see if the window is textured or not, it a window setting in IB. Non-textured windows have no bottom border by default. Its in the AppKit release notes http://developer.apple.com/releasenotes/Cocoa/AppKit.html under the NSWindow heading. Often this is used in conjunction w

Re: Responder Chain Patching

2008-07-14 Thread Jonathan Dann
Have you seen this http://katidev.com/blog/2008/04/17/nsviewcontroller-the-new-c-in-mvc-pt-2-of-3/ and this thread http://www.cocoabuilder.com/archive/message/cocoa/2008/3/19/201743 All of this is covered, with automatic insertion of view controllers into the responder chain. If you want t

Re: Duplicate rows appearing in outlineview after creating new Entity in moc, why?

2008-07-16 Thread Jonathan Dann
The duplicate problem is likely fixed by giving the tee controller a fetch predicate in IB. Set the predicate to something like parent==nil. This will obviously depend on what you've called your 'parent' property. I've blogged about doing this with drag and drop in core data and non- core

Re: Duplicate rows appearing in outlineview after creating new Entity in moc, why?

2008-07-17 Thread Jonathan Dann
the outlineview. Remove the contentSet binding and the problem goes away. It's only 50 lines of code. I don't get it. Cheers, Sean On 7/16/08 1:44 PM, Jonathan Dann said: The duplicate problem is likely fixed by giving the tee controller a fetch predicate in IB. Set the predicate t

Re: Where's the best place for addObserver and removeObserver

2008-07-17 Thread Jonathan Dann
Hi Joan, As Keary says, removing in -dealloc is probably not the best thing to do as there are a few cases that this can bite you, like if your window controller retains the view controllers, and -dealloc is called on the window controller, which would proceed to release its collection of

Re: Flip animation like dashboard widgets

2008-07-18 Thread Jonathan Dann
There was an example of this on Cocoa Is My Girlfriend http://www.cimgf.com/ HTH Jon On 18 Jul 2008, at 08:42, chaitanya pandit wrote: Is there any way to do flip animation like the one with dashboard widgets when u click the "i" to change the settings for the widget. Can it be done for NS

Re: NSViewController Binding Problem continued

2008-07-18 Thread Jonathan Dann
Hi Ivy, You can bind the representedObject in NIB, I do it all the time. My rO is an NSPersistentDocument subclass, which is set immediately after the view controller is -init-ed. The bindings in the nib are only set up after -loadView is called, which occurs after something in your app

Re: NSViewController Binding Problem continued

2008-07-18 Thread Jonathan Dann
Hi Ivy, Can you tell us what the bound object the table receives is? If you could call this method (which, in its current state, would go in an NSTableView subclass) somewhere: - (NSArrayController *)arrayController; { return [[[self tableColumnWithIdentifier:@"myColumn"] infoForBinding

Re: NSOutlineView with Multiple Core Data Entities

2008-07-25 Thread Jonathan Dann
On 25 Jul 2008, at 17:21, Garrett Bjerkhoel wrote: I have a NSOutlineView hooked up to a NSTreeController, which has multiple entities inside of it. I would like to know how to set it up having each entity having its own "group". I have downloaded Jonathan Dann's example, which compiles bu

Re: Drawing a drop-shadow around a view

2008-07-25 Thread Jonathan Dann
How odd I came across this yesterday on my travels! The site for this source is http://www.bergdesign.com/missing_cocoa_docs/nsclipview.html Jonathan www.espresso-served-here.com On 25 Jul 2008, at 11:13, Ian Jackson wrote: Hi Graham, if I understand your question, then I wanted to do som

Re: NSOutlineView with Multiple Core Data Entities

2008-07-25 Thread Jonathan Dann
says: 2008-07-25 12:35:01.031 SortedTree[1526:10b] *** -[ESTreeNode isSpecialGroup]: unrecognized selector sent to instance 0x133d20 On Jul 25, 2008, at 12:33 PM, Jonathan Dann wrote: On 25 Jul 2008, at 17:21, Garrett Bjerkhoel wrote: I have a NSOutlineView hooked up to a NSTreeController, w

Re: reloading an NSTreeController

2008-08-02 Thread Jonathan Dann
On 1 Aug 2008, at 14:04, Gerriet M. Denkmann wrote: But all disclosure triangels are now closed. Is there some way to reopen them to the previous state? I have the strong feeling that I will have to handle this myself. Ok. So be it. It's a common problem. Can I point you here: http://www

Re: reloading an NSTreeController

2008-08-03 Thread Jonathan Dann
On 3 Aug 2008, at 04:35, Gerriet M. Denkmann wrote: On 3 Aug 2008, at 05:51, Jonathan Dann wrote: On 1 Aug 2008, at 14:04, Gerriet M. Denkmann wrote: But all disclosure triangels are now closed. Is there some way to reopen them to the previous state? I have the strong feeling that I

Re: reloading an NSTreeController

2008-08-05 Thread Jonathan Dann
On 4 Aug 2008, at 14:04, Gerriet M. Denkmann wrote: On 3 Aug 2008, at 16:53, Jonathan Dann wrote: On 3 Aug 2008, at 04:35, Gerriet M. Denkmann wrote: On 3 Aug 2008, at 05:51, Jonathan Dann wrote: On 1 Aug 2008, at 14:04, Gerriet M. Denkmann wrote: But all disclosure triangels are now

Re: UTI Example

2008-08-23 Thread Jonathan Dann
Reposted due to 25KB size limit. Sorry. On 23 Aug 2008, at 06:42, Adam Thorsen wrote: Are there any examples of using the UTI API to determine the UTI given a path to a file? Thanks, -Adam In my app I have a singleton UTI controller class that has an NSArray property of UTIs supported by

Re: Semi-transparent, blurred NSWindow background?

2008-08-24 Thread Jonathan Dann
On 24 Aug 2008, at 17:45, Tim Andersson wrote: Hi there, Is there any way of creating a NSWindow that has a semi-transparent, blurred background? With "blurred background" I mean that whatever you see through the window/background is distorted (blurred). Any help is appreciated, Tim Ande

Re: Semi-transparent, blurred NSWindow background?

2008-08-25 Thread Jonathan Dann
On 25 Aug 2008, at 16:58, Tim Andersson wrote: 24 aug 2008 kl. 23.20 skrev Jonathan Dann: On 24 Aug 2008, at 17:45, Tim Andersson wrote: YMMV but I'd start with a window as shown in this sample code http://developer.apple.com/samplecode/RoundTransparentWindow/index.html and then re

Re: Semi-transparent, blurred NSWindow background?

2008-08-25 Thread Jonathan Dann
On 25 Aug 2008, at 21:51, Seth Willits wrote: On Aug 25, 2008, at 1:33 PM, Ricky Sharp wrote: There isn't a particularly fast way to do this, although I have experimented with it a bit in the past. You can use the CGWindow API to read the contents under your window and apply a blur to th

Re: Semi-transparent, blurred NSWindow background?

2008-08-26 Thread Jonathan Dann
On 26 Aug 2008, at 00:52, Graham Cox wrote: On 26 Aug 2008, at 8:00 am, Jonathan Dann wrote: Using the private APIs / the method that Rob showed is perfectly fast. I'd really like this made easier too, so I filed an enhancement request rdar://6174287 Is it possible to file

Re: Using NSPredicate to parse strings

2008-03-03 Thread Jonathan Dann
On 3 Mar 2008, at 16:16, Mike Abdullah <[EMAIL PROTECTED]> wrote: Jonathon, you'll have much better luck with NSScanner. It's designed for exactly what you want. Mike. Thanks Mike, just tried it and it works quite well. Any way of using NSScanner directly with regex? Not su

Re: Using NSPredicate to parse strings

2008-03-04 Thread Jonathan Dann
On 3 Mar 2008, at 18:23, Dave Camp <[EMAIL PROTECTED]> wrote: On Mar 3, 2008, at 10:12 AM, Jonathan Dann wrote: On 3 Mar 2008, at 16:16, Mike Abdullah <[EMAIL PROTECTED]> wrote: Jonathon, you'll have much better luck with NSScanner. It's designed for exactly

Re: regexkit [Using NSPredicate to parse strings]

2008-03-04 Thread Jonathan Dann
On 4 Mar 2008, at 17:50, Jens Alfke wrote: On 4 Mar '08, at 3:25 AM, Jonathan Dann wrote: That is a seriously good framework, and the documentation is great too. My only issue with regexkit is that it uses PCRE instead of ICU. PCRE has to be compiled into the library, making it l

Re: Best place to remove observer for NSViewBoundsDidChangeNotification

2008-03-04 Thread Jonathan Dann
On 25 Feb 2008, at 23:30, Jonathan Dann wrote: On 25 Feb 2008, at 23:15, Jerry Krinock wrote: I presume that sending a notification to a deallocced object causes a crash? Invariably! ;) Oh, yes, it will bite you. Says so right in the documentation of - [NSDocument close]. Funny how

Re: Localise between different versions of English

2008-03-05 Thread Jonathan Dann
On 5 Mar 2008, at 17:25, Christopher Nebel wrote: On Mar 4, 2008, at 9:36 PM, Jens Alfke wrote: On 4 Mar '08, at 3:23 PM, Sean McBride wrote: There's also Canadian English (en_CA), and perhaps others too... The ISO is in the process of adding "en_LOL" for Lolcat, aka Kitteh or Cat Pidgi

10.5.2 release notes?

2008-03-06 Thread Jonathan Dann
Hi Guys, Does anyone know if there are some release notes specific for 10.5.2? I remember reading on some blog that there was an NSTreeController bugfix. I can't seem to be able to find any details on Google other than these http://docs.info.apple.com/article.html?artnum=307109 which h

Re: 10.5.2 release notes?

2008-03-08 Thread Jonathan Dann
However, there often are no developer release note updates for software updates. If there are bugfixes, why is this the case? To answer the original question, there are two NSTreeController bug fixes in 10.5.2; the one you may be thinking of is 5622232: "NSTreeController: points to inval

Re: How to get the name of a method at runtime?

2008-03-09 Thread Jonathan Dann
I think maybe you missed the existence of _cmd. Both self (this object) and _cmd (this selector) are passed as implicit arguments to every Objective-C method. You can also call __func__ from within a method call, I use this often, NSLog(@"%p %s",self,__func__); // Thanks James Bucanek Jo

Core Animation Choppyness

2008-03-10 Thread Jonathan Dann
Hi Guys, I have a couple of views in my app that get re-scaled by changing their frames. When I turn on layer backing for the view, the animation of the views' contents (a couple of NSColorWells & NSButtons) is choppy and renders badly, but when I omit the layer- backing activation the an

Re: Core Animation Choppyness

2008-03-10 Thread Jonathan Dann
On 10 Mar 2008, at 20:26, Chris Ryland wrote: Looks to me like you're mixing NSAnimation and CAAnimation technologies. Try CAAnimationContexts instead? Tried  Googling CAAnimationContext, and I can't find it, where can I read up on them? Thanks, Jon smime.p7s Description: S/MIME crypt

Re: Core Animation Choppyness

2008-03-11 Thread Jonathan Dann
On 10 Mar 2008, at 22:40, Scott Anguish wrote: if you stop the animation of the replaceSubview... is that no longer choppy? This is one of the most expensive animations possible. That fixed it, looks great now! It was a flickering NSPopUpButton that was causing me grief. also, are all

Correct use of NSViewController

2008-03-19 Thread Jonathan Dann
Hi guys, I've ended up with a bloated window controller in my document based app and want to refactor my code using done view controllers. My question is really about design. If I have a split view with which contains a split view (like mail) then should I have a controller for the large

Re: Correct use of NSViewController

2008-03-19 Thread Jonathan Dann
Hi Cathy, Thanks for the comprehensive answer to my question, I wanted to make sure that I wasn't committing heresy by going down the 'tree of view controllers' road before jumping in and refactoring all my code. I was hoping to set it up so I could forget about most of the memory manage

Re: Correct use of NSViewController

2008-03-20 Thread Jonathan Dann
Hi Cathy, Thanks again for your advice. I've got it working now and I'm almost back I where I was before refactoring, I'm now running into a bindings problem. Before using the view controllers I had put 2 tree controllers in my window controller's nib, 2 outline views were then bound to

Re: Correct use of NSViewController

2008-03-21 Thread Jonathan Dann
Hi Cathy and Paul, Thanks to you both for your help, I'm really starting to get somewhere with this now. I now have a view controller hierarchy that reflects the views in my app. I've defined my own view controller subclass that I use and an abstract superclass for the view controllers I

Using CoreAnimation to Show/Hide a SplitView Pane

2008-03-23 Thread Jonathan Dann
Hi All, I've managed to do the above with NSAnimation, but I'm trying to do the same using Core Animation. AFAIK To hide a split view pane when the user clicks a button, you need to set the frame's height/width to zero and move the divider when the animation has finished. When using an i

Re: outlineViewSelectionDidChange not called

2008-03-25 Thread Jonathan Dann
le changes. Not sure if it will cover all the bases you need though. You'd get an array if selection index paths and then just see if the count of the array is 1 for single selection or more if you have multiple. Jonathan Dann On 25 Mar 2008, at 05:42, "Adam Gerson" <[EM

Re: Source list using bindings?

2008-03-25 Thread Jonathan Dann
Ah, thanks. I wonder what the purpose of this subclass is and how fragile this solution? As of 10.5 it's the Apple-sanctioned way to go! I've used it for ages now, no problems at all. The tree node is a proxy for whatever 'real' item you add to the tree. You can also get the selectedNo

Re: outlineViewSelectionDidChange not called

2008-03-26 Thread Jonathan Dann
s" controller key and then the outline view's table column's @"value" binding is set to the tree controller's @"arrangedObjects.nodeName" (nodeName is just an NSString representation of a file path). Doing what you said may not work. On Tue, Mar 2

Re: Source list using bindings?

2008-03-26 Thread Jonathan Dann
On 26 Mar 2008, at 00:45, Hamish Allan wrote: Hi Jon, On Tue, Mar 25, 2008 at 9:49 PM, Jonathan Dann <[EMAIL PROTECTED]> wrote: As of 10.5 it's the Apple-sanctioned way to go! I've used it for ages now, no problems at all. The tree node is a proxy for whatever 

NSLayoutManager & Non-Contiguous Layout

2008-03-26 Thread Jonathan Dann
Hi Guys, I'm using non-contiguous layout in one of my text views and I keep getting this strange drawing error when I scroll quickly just after the document has loaded: http://flickr.com/photos/jonathandann/2364567591/ I have a method that highlights syntax by getting the visible charact

Re: outlineViewSelectionDidChange not called

2008-03-31 Thread Jonathan Dann
Hi Adam, I've found that programmatically changing the selection using the tree controller's -setSelectionIndexPath(s): will always send the NSOutlineViewSelectionDidChangeNotification, you might want to have a look here http://www.wilshipley.com/blog/2006/04/pimp-my-code-part-10-whining-

Menu Key Equivalents Not Displayed

2008-04-06 Thread Jonathan Dann
Hi Guys, This one has me stumped. I have a NSSegmentedControl with a segment that has a menu attached. I set up the menu like this NSMenu *actionMenu = [[[NSMenu alloc] initWithTitle:@"actionMenu"] autorelease]; NSMenuItem *newFileItem = [[[NSMenuItem alloc] initWithTitle:NSLocalizedStr

Re: Menu Key Equivalents Not Displayed

2008-04-06 Thread Jonathan Dann
On Apr 6, 2008, at 12:01 PM, Jonathan Dann wrote: However the command-G does not show up on the menu. The same happens if I set the key equivalent to @"p", @"q" and some others, but equivalents like @"u" and @"b" work fine. Can anyone verify thi

Re: Menu Key Equivalents Not Displayed

2008-04-06 Thread Jonathan Dann
On 6 Apr 2008, at 20:47, j o a r wrote: On Apr 6, 2008, at 12:37 PM, Jonathan Dann wrote: Yeah I thought that, but couldn't see where g was defined. Typically under Edit > Find Any idea why it works in other contextual menus, including the main menu? Please file a bug report

Re: Menu Key Equivalents Not Displayed

2008-04-06 Thread Jonathan Dann
On 7 Apr 2008, at 01:16, Michael Ash wrote: In short, if your shortcut conflicts with an existing one then it won't show. But if it matches an existing one including in terms of behavior, then it will show. Yeah but that wasn't happening, my command-G shortcut was conflicting with the Find

Re: NSTreeController / CoreData still broken in 10.5?

2008-04-09 Thread Jonathan Dann
On 7 Apr 2008, at 23:52, Adam Gerson wrote: However, I am using CoreData with my TreeController bound to a Managed Object Context. Can I still supply a contentArray in this situation? Adam On Sun, Apr 6, 2008 at 9:36 AM, Jonathan Dann <[EMAIL PROTECTED]> wrote: Hi Adam, I&#

Re: HUD-style panel controls?

2008-04-13 Thread Jonathan Dann
In the mean time, there is this. http://lipidity.com/apple/ilife-controls-hud-windows-and-more Jon On Sat, Apr 12, 2008 at 7:21 PM, Michael Watson <[EMAIL PROTECTED]> wrote: You aren't missing anything. Apple gave us an official HUD panel and UI guidelines surrounding it, and failed to prov

Subclassing NSScroller

2008-04-13 Thread Jonathan Dann
Hi All, I'm trying to re-create the iTunes and HUD window scrollbars for my project. I've managed to get a good looking NSScrollerKnob, and NSScrollerKnobSlot using bezier paths and gradients, but now I'm moving on to the arrows and the curved ends of the slot. To get the knob I've overr

Re: Subclassing NSScroller

2008-04-14 Thread Jonathan Dann
On 14 Apr 2008, at 02:12, Chris Hanson wrote: On Apr 13, 2008, at 3:13 PM, [EMAIL PROTECTED] wrote: I believe this is a typo in the documentation. The method you want to override is actually spelled -drawArrow:highlightParts: In

Core Data and Run Loops

2008-04-30 Thread Jonathan Dann
Hi All, I'm now learning Core Data and was working through the persistent document tutorial when I hit a snag. After following the advice in the "Adpoting the Mediator Pattern" the object controller now simply prepares its content and fetches the department object. I then tried in my w

[OT] South Wales UK NSCoder Night

2008-05-11 Thread Jonathan Dann
Hi All! I'm trying to set up an NSCoder Night in South Wales, UK. Hopefully meeting somewhere in either Cardiff or Swansea. If anyone is interested then please contact me off-list, I'd like to know that I'm not the only developer around for miles! Hope to hear from you soon, Jonathan

Re: CGPoint wrapper?

2008-10-23 Thread Jonathan Dann
If you're targeting Leopard then you can use the NS_BUILD_32_LIKE_64 flag and use NSRect/Point/Size and CGRect/Point/Size interchangeably without the cast or the inline conversion functions. Here's a how-to http://theocacao.com/document.page/552 Jonathan http://espresso-served-here.com On 2

Re: Using Core Animation to animate view properties?

2008-10-23 Thread Jonathan Dann
Hi Jim, I've been having major problems with working with non-layer-baked views to coordinate the animation of their positions. Some of the caveats I've come across (note that I haven't used -setWantsLayer: on any of the views as it's unnecessary for animating the frame of an NSView with

Moving a window offscreen

2009-03-06 Thread Jonathan Dann
Hi All, In my application I want to create an image of a document window as a preview prior to displaying the window to the user. To obtain the CGImage of a displayed window is simple enough using the CGWindow API as shown below: - (CGImageRef)CGImage; { return CGWindowListCreateImage(CG

Re: Moving a window offscreen

2009-03-07 Thread Jonathan Dann
On 7 Mar 2009, at 05:50, Michael Ash wrote: On Fri, Mar 6, 2009 at 1:38 PM, Jonathan Dann wrote: Hi All, In my application I want to create an image of a document window as a preview prior to displaying the window to the user. To obtain the CGImage of a displayed window is simple enough

  1   2   >