Re: Controlling line-breaking in a text view

2008-08-09 Thread Ken Ferry
Hi Andy, I have never needed to work with this stuff, but with that caveat: Have you tried subclassing NSTextStorage and implementing -lineBreakBeforeIndex:withinRange:? -Ken On Sat, Aug 9, 2008 at 8:43 PM, Andy Kim <[EMAIL PROTECTED]> wrote: > Hi, > > I'm having trouble figuring out how to mak

Controlling line-breaking in a text view

2008-08-09 Thread Andy Kim
Hi, I'm having trouble figuring out how to make the text system not break words that begin with a '/', such as paths, when wrapping. Let's say that we're laying out the following line of text: = Normally, you should never delete /Applications

Re: Challenge 18 in Hillegass Book

2008-08-09 Thread James Gorham
On Aug 8, 2008, at 6:40 PM, Graham Cox wrote: So there needs to be a connection between model, controller and view that allows you to communicate freely back and forth. For now you could just use the view as the model, unless you are really keen to explore MVC at this point rather than jus

Re: generating a moveRight

2008-08-09 Thread James Maxwell
OOps! Sorry folks... tricky answer, that was... "nil" ;-) J. On 9-Aug-08, at 5:30 PM, James Maxwell wrote: I'm trying to programmatically generate a -moveRight: action, using sendAction:to:from. The action for this is, of course, pressing the right arrow key, but how do I "fake" that progr

generating a moveRight

2008-08-09 Thread James Maxwell
I'm trying to programmatically generate a -moveRight: action, using sendAction:to:from. The action for this is, of course, pressing the right arrow key, but how do I "fake" that programmatically? Basically, I'm wondering how to define the "sender" for the "from:" in - sendAction:to:from:?

Re: Custom URL Handling

2008-08-09 Thread Uli Kusterer
On 10.08.2008, at 01:50, Jacob Bandes-Storch wrote: It doesn't seem to make sense to use the script suite stuff to receive the URL event.. shouldn't it be used for scripting only? Or am I mistaken? Apple Events are simply a means for applications to communicate. Just like you can use App

Re: compiling a bundle on intel?

2008-08-09 Thread Jonathan deWerd
On Aug 9, 2008, at 5:22 PM, Bob Sabiston wrote: Hi, I have a Cocoa bundle that I compile with my Carbon program. I used the Apple examples to do it, and I don't have a very thorough understanding of Cocoa or bundles. However, on my G5 w/ Codewarrior compiling (still!), it actually wo

Re: Custom URL Handling

2008-08-09 Thread Jacob Bandes-Storch
It doesn't seem to make sense to use the script suite stuff to receive the URL event.. shouldn't it be used for scripting only? Or am I mistaken? On Aug 9, 2008, at 3:03 PM, Uli Kusterer wrote: I see some implementations use -[NSAppleEventManager setEventHandler:andSelector:forEventClass:an

Re: I don't understand why this is leaking...

2008-08-09 Thread Jonathan deWerd
On Aug 9, 2008, at 4:48 PM, Cate Tony wrote: This code is leaking: - (void)saveItemExtensions:(id)sender { NSMutableString* itemExtensionsFilePath = [NSMutableString stringWithString:@"~/Library/Preferences/MyApp/extensions.abc"]; NSDictionary* extensions = [NSDictionary dictionaryWithD

compiling a bundle on intel?

2008-08-09 Thread Bob Sabiston
Hi, I have a Cocoa bundle that I compile with my Carbon program. I used the Apple examples to do it, and I don't have a very thorough understanding of Cocoa or bundles. However, on my G5 w/ Codewarrior compiling (still!), it actually works. I have to compile the bundle using Xcode,

I don't understand why this is leaking...

2008-08-09 Thread Cate Tony
This code is leaking: - (void)saveItemExtensions:(id)sender { NSMutableString* itemExtensionsFilePath = [NSMutableString stringWithString:@"~/Library/Preferences/MyApp/extensions.abc"]; NSDictionary* extensions = [NSDictionary dictionaryWithDictionary: [itemDataSource itemExtensions]];

Re: Does [NSApp setApplicationIconImage] leak memory?

2008-08-09 Thread Shawn Erickson
On Sat, Aug 9, 2008 at 2:46 PM, Mark Allan <[EMAIL PROTECTED]> wrote: > I fail to see how [NSApp setApplicationIconImage:theNewImage]; is any > different to [NSApp setApplicationIconImage:[theNewImage objectAtIndex:1]] > but it obviously does function differently. Please post a complete code exam

Re: Custom URL Handling

2008-08-09 Thread Uli Kusterer
On 09.08.2008, at 22:53, Jacob Bandes-Storch wrote: I want to implement a custom URL scheme (such that myscheme:whatever will open my app and somehow pass the URL as a parameter). I've been looking around for information on how to do that, and I'm getting mixed messages. I'm not a specia

Re: Does [NSApp setApplicationIconImage] leak memory?

2008-08-09 Thread Mark Allan
>Your idea of removing the array from the equation also solves the leak and I suspect is more efficient than creating and releasing a tonne of autorelease pools. Really? Can you explain what "removing the array from the equation" has to do with the memory behavior you're seeing? m. No, sadly

Custom URL Handling

2008-08-09 Thread Jacob Bandes-Storch
I want to implement a custom URL scheme (such that myscheme:whatever will open my app and somehow pass the URL as a parameter). I've been looking around for information on how to do that, and I'm getting mixed messages. The Info.plist documentation is very clear, and I've got the keys all

Re: Problem with friend function and gcc 4.2 with

2008-08-09 Thread Ken Worley
FWIW, it does in fact compile in 4.2 (and in 4.0) when formatted as you suggest. I still believe the original format is correct and that 4.2 is the version with the bug. The info Clark Cox pointed out seems to support that. In any case, a bug has been filed, so I'll know Apple's point of vi

Re: Does [NSApp setApplicationIconImage] leak memory?

2008-08-09 Thread Matt Neuburg
On Fri, 8 Aug 2008 23:53:08 +0100, Mark Allan <[EMAIL PROTECTED]> said: >>On Fri, Aug 8, 2008 at 9:02 AM, Matt Neuburg <[EMAIL PROTECTED]> wrote: >>> On Thu, 7 Aug 2008 20:14:04 +0100, Mark Allan <[EMAIL PROTECTED]> >>> said: Hi all, Before I file a bug report against this, I just th

Re: Key Binding action methods not declared in public headers

2008-08-09 Thread Ross Carter
On Aug 8, 2008, at 4:44 PM, Douglas Davidson wrote: The right thing to do would be to file a bug requesting publication of those methods, and to inquire in the bug whether it would be safe to override them regardless of their current status. Douglas Davidson Thanks, Douglas. bug #61

Re: Problem with friend function and gcc 4.2 with objective-c++

2008-08-09 Thread Clark Cox
On Sat, Aug 9, 2008 at 2:20 AM, Thomas Engelmeier <[EMAIL PROTECTED]> wrote: > > Am 08.08.2008 um 00:09 schrieb Ken Worley: > >> Hi all, >> >> I'm using Xcode 3.1 and just switched to gcc 4.2 from 4.0, but I've run >> into a problem with friend functions when compiling in objective-c++. I >> contri

[MEET] Syracuse Area CocoaHeads

2008-08-09 Thread Michael Fey
Folks, Just a small note that we will be meeting a couple of days earlier than the usual time. Plan to get together with us at the Fayetteville Free Library on this Tuesday August 12th at 7PM EST. See http://fruitstandsoftware.com/CocoaHeads/ for maps and more info. Regards, Micha

Re: Does [NSApp setApplicationIconImage] leak memory?

2008-08-09 Thread Michael Ash
On Fri, Aug 8, 2008 at 6:48 PM, Mark Allan <[EMAIL PROTECTED]> wrote: >> On Thu, 7 Aug 2008 20:14:04 +0100, Mark Allan >> <[EMAIL PROTECTED]> >> said: >>> >>> Hi all, >>> >>> Before I file a bug report against this, I just thought I'd check I'm >>> not being monumentally stupid first! >>> >>> I'm t

Re: Using @selector()

2008-08-09 Thread Uli Kusterer
On 09.08.2008, at 11:23, Christian Giordano wrote: yep, it works with that :) I presume it is an error in the book. Probably. Or they hooked up the target in IB before that. Personally I thought that passing the method not as string it would have recognized the scope (target) automatically.

Re: Using @selector()

2008-08-09 Thread Christian Giordano
yep, it works with that :) I presume it is an error in the book. Personally I thought that passing the method not as string it would have recognized the scope (target) automatically. Thanks a lot, chr On Sat, Aug 9, 2008 at 9:45 AM, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: > > Le 9 août 08 à

Re: Problem with friend function and gcc 4.2 with objective-c++

2008-08-09 Thread Thomas Engelmeier
Am 08.08.2008 um 00:09 schrieb Ken Worley: Hi all, I'm using Xcode 3.1 and just switched to gcc 4.2 from 4.0, but I've run into a problem with friend functions when compiling in objective- c++. I contrived an example that illustrates the problem: [...] This project builds fine using gcc

Re: Using @selector()

2008-08-09 Thread Jean-Daniel Dupas
Le 9 août 08 à 10:34, Christian Giordano a écrit : Hi guys, I'm a newbie and I'm reading a book which shows the two different option to link programmatically a control to an action: SEL mySelector; mySelector = @selector(methodName:); [myButton setAction:mySelector]; OR SEL mySelector; mySel

Re: How to tell whether an executable supports GC?

2008-08-09 Thread Jean-Daniel Dupas
You can also create your own helper tool compiled with GC support and, that just preflight the bundle you pass as argument and return the result. It's a little more works, but it's cleaner too. Le 9 août 08 à 03:32, André Pang a écrit : On 08/08/2008, at 3:18 PM, Chris Suter wrote: You w

Using @selector()

2008-08-09 Thread Christian Giordano
Hi guys, I'm a newbie and I'm reading a book which shows the two different option to link programmatically a control to an action: SEL mySelector; mySelector = @selector(methodName:); [myButton setAction:mySelector]; OR SEL mySelector; mySelector = NSSelectorFromString(@"methodName:"); [myButton

Re: Dragging broken symlinks

2008-08-09 Thread Gerriet M. Denkmann
On 9 Aug 2008, at 12:27, Ken Thomases wrote: On Aug 8, 2008, at 11:26 PM, Gerriet M. Denkmann wrote: I have an app which can open symlinks (not the thing the symlink points to). Done via [ openPanel setResolvesAliases: NO ]; But when I drag a symlink to the icon of my app in the dock, -

Re: NSArrayController's selectedIndexes

2008-08-09 Thread Ryan Brown
Never mind, the "(Missing) KVO notification old and new values" section on mmalc's Cocoa Bindings Examples and Hints confirmed that this is a bug. It mentions that this won't be fixed for the forseeable future... could someone elaborate as to why? Ryan On Aug 9, 2008, at 12:24 AM, Ryan Bro

NSArrayController's selectedIndexes

2008-08-09 Thread Ryan Brown
When I observe an NSArrayController's selectedIndexes key like so: - (void)awakeFromNib { [arrayController addObserver:self forKeyPath:@"selectionIndexes" options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld) context:nil]; } - (void)observeValueForKeyPath:(NSString *)keyPat