Re: Possible causes of "attempted layout while textStorage is editing"?

2011-08-31 Thread Gideon King
Here is the complete stack trace 2011-08-31 15:25:11 -0400[5]: ERROR - 14764064ms (NMApplication.m:81) -[NMApplication handleRunException:] - NSException Exception encountered: -[AAMainEditingLayoutManager _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] *** attempted layout whil

Re: setTitleWithMnemonic

2011-08-31 Thread KappA
I never said I was using the "mnemonic" feature... just using it for setting plain text. Is that what you are curious to see? Kappa On Thu, Sep 1, 2011 at 12:07 AM, Jerry Krinock wrote: > > On 2011 Aug 31, at 16:42, Fritz Anderson wrote: > > > I don't think it's because there's a strong '90s-re

Re: Linking an NSWindow in IB

2011-08-31 Thread Guy Halford-Thompson
Thanks for all the responses. I have managed to get it working using Jens response... it seems I got a bit confused about how the linking via IB goes. @Ron, thanks for the recommendation, I am finding it very difficult to find good resources for Cocoa programming, and the apple developer docs are

Re: setTitleWithMnemonic

2011-08-31 Thread Jerry Krinock
On 2011 Aug 31, at 16:42, Fritz Anderson wrote: > I don't think it's because there's a strong '90s-revival faction in the > AppKit team Oh? How about the '90s-revival faction who recently decided it was cool to be able to resize a window by dragging any edge? :)) On 2011 Aug 31, at 18:51, Ka

Re: Linking an NSWindow in IB

2011-08-31 Thread Conrad Shultz
Sorry I'm on my phone so I can't write a detailed response, but you're just structuring your app kind of backwards. In IB you would want to have a connection between your custom window and an outlet in your app delegate in this case. You would then send the window an "order front" message from

Re: Linking an NSWindow in IB

2011-08-31 Thread Jens Alfke
MYWindow isn’t a window, it’s an NSObject that can act as a window delegate. So creating one isn’t going to create a window. You don’t have any code that creates a window; there’s a window property but nothing that sets it. Also, you’re calling a -showWindow: method on your MyWindow class, but y

Re: Linking an NSWindow in IB

2011-08-31 Thread Guy Halford-Thompson
Hi, Thanks for the help, I really appreciate it. I still appear to be having some trouble tho. Here is my code: MyWindow.h #import @interface MyWindow : NSObject { IBOutlet NSWindow *window; } -(void)showWindow:(id)sender; @property (assign) IBOutlet NSWindow *window;

Re: Problems with firstResponder

2011-08-31 Thread Ron Fleckner
Hello Geert, I'm certainly no expert. However, I've noticed that people learning Cocoa (and/or OOP) often directly set things that in fact don't need setting at all. A lot of the basic functionality of Cocoa based apps comes for free. Things like the responder chain usually do the right thin

Re: setTitleWithMnemonic

2011-08-31 Thread KappA
Interesting. I actually use that API to set the text successfully in my applications, so far without any problems. Thanks, Kappa On Wed, Aug 31, 2011 at 7:42 PM, Fritz Anderson wrote: > On 31 Aug 2011, at 2:00 PM, Rajendran P wrote: > > > is it advisable to use the API setTitleWithMnemonic ? th

Re: Size of a file on disk

2011-08-31 Thread Martin Wierschin
>>> NSFileHandle *hndl = [NSFileHandle fileHandleForReadingAtPath:path]; >>> long long lngth = [hndl seekToEndOfFile]; >>> >>> This gets you the length in bytes. >> >> And loads the entire file into memory!! > > Does it? I didn't think seek loaded anything, and it was just for

Re: Won't Applescript command use defined ivars?

2011-08-31 Thread Martin Wierschin
> But I am going to need the application to use the instance of the class from > when it's started, not make a new instance every time the script command is > given. As Scott mentioned, that's not how the Cocoa framework works with regard to AppleScript. It's going to create a new instance of y

Re: setTitleWithMnemonic

2011-08-31 Thread Fritz Anderson
On 31 Aug 2011, at 2:00 PM, Rajendran P wrote: > is it advisable to use the API setTitleWithMnemonic ? the document discussion > says > > "Discussion > Mnemonics are not supported in Mac OS X. " > > strangely , the API is not deprecated Given that the method has never had any effect in the te

Re: Size of a file on disk

2011-08-31 Thread Andy Lee
I hate when that happens. --Andy On Aug 31, 2011, at 7:33 PM, Kyle Sluder wrote: > On Wed, Aug 31, 2011 at 4:32 PM, Andy Lee wrote: >> Does it? I didn't think seek loaded anything, and it was just for random >> access. > > Yeah, my brain substituted -readDataToEndOfFile. > > --Kyle Sluder _

Re: Size of a file on disk

2011-08-31 Thread Kyle Sluder
On Wed, Aug 31, 2011 at 4:32 PM, Andy Lee wrote: > Does it? I didn't think seek loaded anything, and it was just for random > access. Yeah, my brain substituted -readDataToEndOfFile. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: Size of a file on disk

2011-08-31 Thread Andy Lee
On Aug 31, 2011, at 7:27 PM, Kyle Sluder wrote: > On Wed, Aug 31, 2011 at 4:21 PM, dct wrote: >> Jon >> >> Or, knowing the path, you might try using NSFileHandle : >> >> NSFileHandle *hndl = [NSFileHandle fileHandleForReadingAtPath:path]; >> long long lngth = [hndl seekToEndOfFi

Re: Size of a file on disk

2011-08-31 Thread Kyle Sluder
On Wed, Aug 31, 2011 at 4:21 PM, dct wrote: > Jon > > Or, knowing the path,  you might try using NSFileHandle : > >  NSFileHandle   *hndl = [NSFileHandle fileHandleForReadingAtPath:path]; >  long long             lngth = [hndl seekToEndOfFile]; > > This gets you the length in bytes. And loads the

Re: Size of a file on disk

2011-08-31 Thread dct
Jon Or, knowing the path, you might try using NSFileHandle : NSFileHandle *hndl = [NSFileHandle fileHandleForReadingAtPath:path]; long long lngth = [hndl seekToEndOfFile]; This gets you the length in bytes. Don ___ Cocoa-dev mailin

Re: Size of a file on disk

2011-08-31 Thread Charles Srstka
I think the NSURL methods are actually the “preferred” way to do it these days on the Mac, since the NSFileManager method takes paths, and URLs are clearly the direction that Apple is moving. In addition to NSURLFileSizeKey and NSURLFileAllocatedSizeKey, which will give you the logical and phys

setTitleWithMnemonic

2011-08-31 Thread Rajendran P
hi All, Question 1 : is it advisable to use the API setTitleWithMnemonic ? the document discussion says "Discussion Mnemonics are not supported in Mac OS X. " strangely , the API is not deprecated Question 2 : if the answer is yes for the Question 1 , how do i do a binding with Mnuemon

Re: Possible causes of "attempted layout while textStorage is editing"?

2011-08-31 Thread Martin Wierschin
> _fillLayoutHoleForChar acterRange:desiredNumberOfLines:isSoft: *** attempted > layout while textStorage is editing. It is not valid to cause the > layoutManager to do layout while the textStorage is editing (ie the > textStorage has been sent a beginEditing message without a matching > endEdi

Re: Problems with firstResponder

2011-08-31 Thread Geert-Jan Korsbø Nilsen
Thanks, Ron, I did put in the following code instead of becomeFirstResponder: FakturaAppDelegate *appDelegate = (FakturaAppDelegate *)[[NSApplication sharedApplication] delegate]; [appDelegate.window makeFirstResponder:self.invoiceCredit]; Now nothing works... On Aug 31, 2011, at 11:22 PM, Ro

Re: Problems with firstResponder

2011-08-31 Thread Ron Fleckner
On 01/09/2011, at 7:05 AM, Geert-Jan Korsbø Nilsen wrote: > Im working on a tiny app just to learn cocoa, and Im having a hard time with > setting FirstResponder to some NSTextFields. > > When the view opens, I want the first NSTextField, clientNumber, to be > selected, so I trigger [clientNum

Re: ARC + CF types

2011-08-31 Thread Thomas Davie
On 31 Aug 2011, at 21:55, Clark Cox wrote: > On Mon, Aug 29, 2011 at 7:20 AM, Thomas Davie wrote: >> I'm not really very clear on how ARC and CF types are meant to interact yet, >> because of that I've managed to create some buggy code, could someone have a >> quick stare at this and tell me w

Problems with firstResponder

2011-08-31 Thread Geert-Jan Korsbø Nilsen
Im working on a tiny app just to learn cocoa, and Im having a hard time with setting FirstResponder to some NSTextFields. When the view opens, I want the first NSTextField, clientNumber, to be selected, so I trigger [clientNumber becomeFirstResponder] at the end of my loadView method, but it do

Re: ARC + CF types

2011-08-31 Thread Clark Cox
On Mon, Aug 29, 2011 at 7:20 AM, Thomas Davie wrote: > I'm not really very clear on how ARC and CF types are meant to interact yet, > because of that I've managed to create some buggy code, could someone have a > quick stare at this and tell me what I've misunderstood that's causing a > segfaul

Re: LLVM 2.1 Error

2011-08-31 Thread Bruce Cresanta
No, there is no such file at that path. On Aug 31, 2011, at 12:08 AM, Jens Alfke wrote: > > On Aug 29, 2011, at 11:04 PM, Bruce Cresanta wrote: > >> clang: error: no such file or directory: >> '/Volumes/Volume/proSEOLion/proSEO/proSEO/proSEO-Prefix.pch' >> clang: error: no input files >> Co

Re: Size of a file on disk

2011-08-31 Thread Martin Hewitson
Hi Jon, You can do something like: NSFileManager *fm = [NSFileManager defaultManager]; NSDictionary *fattrs = [fm attributesOfItemAtPath:fullpath error:NULL]; sizeOnDisk = [fattrs objectForKey:NSFileSize]; Martin On Aug 31, 2011, at 09:51 PM, Jon Sigman wrote: > How does one determ

Re: Size of a file on disk

2011-08-31 Thread Nick Zitzmann
On Aug 31, 2011, at 1:51 PM, Jon Sigman wrote: > How does one determine the size of a file on disk using Cocoa? > I've looked at NSFileManager but it doesn't seem to offer any > methods for finding file attributes. If you don't care about the size of the resource fork if present:

Re: Size of a file on disk

2011-08-31 Thread Jon Sigman
Many thanks to all who responded.  Somehow I didn't notice the attributes methods of NSFileManager.  I've got it working! -Jon ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. C

Re: Size of a file on disk

2011-08-31 Thread Andy Lee
On Aug 31, 2011, at 3:51 PM, Jon Sigman wrote: > How does one determine the size of a file on disk using Cocoa? > I've looked at NSFileManager but it doesn't seem to offer any > methods for finding file attributes. > OSX 10.6.8 NSFileManager has attributesOfItemAtPath:error:. Not to be confuse

Re: Size of a file on disk

2011-08-31 Thread Hank Heijink (Mailinglists)
See the documentation for - (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error in NSFileManager. The returned dictionary has a convenience method -fileSize. Best, Hank On Aug 31, 2011, at 3:51 PM, Jon Sigman wrote: > How does one determine the size of a file on dis

Re: Size of a file on disk

2011-08-31 Thread Gary L. Wade
If all you care about is the logical size of the datafork of a file, NSFileManager's method attributesOfItemAtPath:error: will give you a dictionary, but if you want to factor in the physical size, resource fork, or extended attributes, you'll need to use a lower-level API, such as FSGetCatalogInfo

Re: Size of a file on disk

2011-08-31 Thread Jens Alfke
On Aug 31, 2011, at 12:51 PM, Jon Sigman wrote: > How does one determine the size of a file on disk using Cocoa? > I've looked at NSFileManager but it doesn't seem to offer any > methods for finding file attributes. You mean like -attributesOfItemAtPath:error: ? :) It returns a dictionary of

Re: Size of a file on disk

2011-08-31 Thread Conrad Shultz
NSFileManager's attributesOfItemAtPath:error: (Sent from my iPhone.) -- Conrad Shultz www.synthetiqsolutions.com On Aug 31, 2011, at 12:51, Jon Sigman wrote: > How does one determine the size of a file on disk using Cocoa? > I've looked at NSFileManager but it doesn't seem to offer any > met

Re: Size of a file on disk

2011-08-31 Thread Kyle Sluder
On Wed, Aug 31, 2011 at 12:51 PM, Jon Sigman wrote: > How does one determine the size of a file on disk using Cocoa? > I've looked at NSFileManager but it doesn't seem to offer any > methods for finding file attributes. You mean other than -attributesOfItemAtPath:error:? http://developer.apple.c

Size of a file on disk

2011-08-31 Thread Jon Sigman
How does one determine the size of a file on disk using Cocoa?  I've looked at NSFileManager but it doesn't seem to offer any  methods for finding file attributes.  OSX 10.6.8 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post adm

Re: LLVM 2.1 Error

2011-08-31 Thread Bruce Cresanta
Jens, The compiler crashes when compiling the pch file. There is not an extra proSEO in the path. GCC_CHAR_IS_UNSIGNED_CHAR = NO GCC_ENABLE_ASM_KEYWORD = YES GCC_C_LANGUAGE_STANDARD = gnu99 GCC_INPUT_FILETYPE = automatic GCC_ENABLE_CPP_EXCEPTIONS = YES GCC_ENABLE_CPP_RTTI = YES GCC_LI

Re: LLVM 2.1 Error

2011-08-31 Thread Jens Alfke
On Aug 31, 2011, at 11:05 AM, Bruce Cresanta wrote: > GCC_PREFIX_HEADER = proSEO/proSEO-Prefix.pch What’s the path of the project file itself? —Jens___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: LLVM 2.1 Error

2011-08-31 Thread Bruce Cresanta
/Volumes/Volume/proSEOLion/proSEO inside of that directory there is anotherproSEO. Bruce On Aug 31, 2011, at 11:16 AM, Jens Alfke wrote: > > On Aug 31, 2011, at 11:05 AM, Bruce Cresanta wrote: > >> GCC_PREFIX_HEADER = proSEO/proSEO-Prefix.pch > > What’s the path of the project file it

Re: Long delay of NSPopUpButton first click

2011-08-31 Thread Kyle Sluder
On Wed, Aug 31, 2011 at 10:05 AM, Jens Alfke wrote: > > On Aug 31, 2011, at 2:19 AM, Rimas M. wrote: > >> Not really. Unless I am missing something. Menu-item's background is >> changing when item is selected (blue one, by default). > > C’mon, be creative. Cache two copies of the image, one with

Re: Long delay of NSPopUpButton first click

2011-08-31 Thread Jens Alfke
On Aug 31, 2011, at 2:19 AM, Rimas M. wrote: > Not really. Unless I am missing something. Menu-item's background is changing > when item is selected (blue one, by default). C’mon, be creative. Cache two copies of the image, one with the plain background and one with the highlighted. —Jens

Re: Won't Applescript command use defined ivars?

2011-08-31 Thread Scott Ribe
On Aug 31, 2011, at 8:58 AM, Chris Paveglio wrote: > But I am going to need the application to use the instance of the class from > when it's started, not make a new instance every time the script command is > given. Well, that's not likely to happen, because that's not the way the framework w

Re: Long delay of NSPopUpButton first click

2011-08-31 Thread Glenn L. Austin
On Aug 31, 2011, at 2:19 AM, Rimas M. wrote: > On Mon, Aug 29, 2011 at 7:13 PM, Jens Alfke wrote: > > On Aug 28, 2011, at 11:25 PM, Rimas M. wrote: > >> Well.. that worked. Generally. But those images must have transparent >> background. And as I have discovered, when dealing with text drawing

Re: Won't Applescript command use defined ivars?

2011-08-31 Thread Chris Paveglio
Ah OK that sheds some light on things. Thanks Martin. Yes I have subclassed NSScriptCommand, as it seemed to be the only way I could get any Applescript command to work by using "performDefaultImplementation". But I am going to need the application to use the instance of the class from when it's

Re: Linking an NSWindow in IB

2011-08-31 Thread Ron Fleckner
On 31/08/2011, at 3:30 PM, Guy Halford-Thompson wrote: > This is somewhat of a basic question, but I am having a lot of trouble > getting it to work. > > When my app loads, I check for certain parameters, and then display an > NSWindow. > > I have created the window in IB and also created a cu

Re: Long delay of NSPopUpButton first click

2011-08-31 Thread Rimas M.
On Mon, Aug 29, 2011 at 7:13 PM, Jens Alfke wrote: > > On Aug 28, 2011, at 11:25 PM, Rimas M. wrote: > > Well.. that worked. Generally. But those images must have transparent > background. And as I have discovered, when dealing with text drawing, that > causes loose of sub-pixels antialiasing. Th

Re: LLVM 2.1 Error

2011-08-31 Thread Jens Alfke
On Aug 29, 2011, at 11:04 PM, Bruce Cresanta wrote: > clang: error: no such file or directory: > '/Volumes/Volume/proSEOLion/proSEO/proSEO/proSEO-Prefix.pch' > clang: error: no input files > Command /Developer/usr/bin/clang failed with exit code 1 Is there such a file at that path? If not, what

Re: Linking an NSWindow in IB

2011-08-31 Thread Jens Alfke
On Aug 30, 2011, at 10:30 PM, Guy Halford-Thompson wrote: > I have created the window in IB and also created a custom class > (MyWindow). in IB I have given the window class MyWindow. > > I have added a couple of extra functions to MyWindow and now I wish to > trigger the window to be displayed

Re: Large over 100K pixel high ruler scroll view

2011-08-31 Thread Jens Alfke
On Aug 30, 2011, at 9:49 PM, Julie Porter wrote: > What I do not get, is why an accessor such as an abstract getObject can not > get the Object from the open and instantiated MyDocument class. I think maybe you’re not thinking the right way about “instantiated” (and “open” really doesn’t mean