Re: Dividing NSView to subviews

2009-04-26 Thread Peter N Lewis
On 27/04/2009, at 12:16 , Naresh Kongara wrote: in the view drawing code i didn't changed any thing. After preparing the view from which i need to get the images, i just replaced the line NSImage *img = [[[NSImage alloc] initWithData:[view dataWithPDFInsideRect:sourceRect]] autorelease];

NSDateFormatter bug in timeZone

2009-04-26 Thread Jon
it appears there is a bug in Apple's date formatter: NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init]; [inputFormatter setDateFormat:@"MMM-dd-yy HH:mm:ss zzz"]; NSDate *theDate = [inputFormatter dateFromString:@"Apr-04-09 10:

Re: figuring out which TableView I am?

2009-04-26 Thread Michael Ash
On Sun, Apr 26, 2009 at 8:04 PM, Graham Cox wrote: > > On 27/04/2009, at 9:31 AM, Jim Correia wrote: > >> I want table 1 to have a blue background, so I set its tag to 3. >> I want table 2 to also have a blue background, so I set its tag to 3. >> >> I want table 1 to have red text. Switch off tag,

Re: Dividing NSView to subviews

2009-04-26 Thread Naresh Kongara
Hi, To get the image, I added the below method (what peter has given) in NSView's category - (NSImage *)imageFromRect:(NSRect) sourceRect { NSSize imgSize = sourceRect.size; NSBitmapImageRep *bir = [self bitmapImageRepForCachingDisplayInRect:sourceRect]; [bir s

Re: Drawing Across NSTableView Columns

2009-04-26 Thread Jerry Krinock
On 2009 Apr 26, at 15:29, K. Darcy Otto wrote: (d) I read about drawing within a custom NSTextField Cell here: http://www.cocoabuilder.com/archive/message/cocoa/2004/3/1/100423 I think this might still make the image break at each row. This is the best option, and yes your line will be brok

Re: figuring out which TableView I am?

2009-04-26 Thread WT
On Apr 27, 2009, at 1:31 AM, Jim Correia wrote: On Sun, Apr 26, 2009 at 7:05 PM, WT wrote: More importantly, perhaps, is the fact that adding property/ivars is not a scalable solution in that it requires adding more code in several places if more tables are added. The tags solution only re

Re: figuring out which TableView I am?

2009-04-26 Thread Jim Correia
On Sun, Apr 26, 2009 at 8:04 PM, Graham Cox wrote: > This is true, but your example of non-scalability does reflect a poor > approach that you wouldn't be likely to follow in practice. > > A tag is 32 bits, so can represent 2^32 different states, if used wisely. > Dividing this into bitfields wou

Re: figuring out which TableView I am?

2009-04-26 Thread WT
On Apr 27, 2009, at 2:19 AM, Greg Guerin wrote: Jonathan Hess wrote: Why not have a property/instance-variable that controls this directly and then set that in awakeFromNib from one of the controller classes that has an outlet to each of the table views? If you needed a fully scalable sol

Re: Core Data Suddenly Losing Changes

2009-04-26 Thread Jerry Krinock
On 2009 Apr 26, at 16:23, Walker Argendeli wrote: I've been working on a project that uses Core Data for a while now. I recently changed the model and ran it, but I noticed an odd behavior: I wan't informed that the model had changed and was incompatible. I went ahead and deleted the old

Re: NSPopUpButtonCell Keeps on Trackin'! Demo, Movie

2009-04-26 Thread Jerry Krinock
On 2009 Apr 26, at 15:29, Jim Correia wrote: What you've done is replaced the table column's header cell, and started a menu tracking session while the table view was already in the middle of a mouse tracking session. Yes, that makes sense because I notice that clicking in the table view do

Re: figuring out which TableView I am?

2009-04-26 Thread Jonathan Hess
On Apr 26, 2009, at 5:19 PM, Greg Guerin wrote: Jonathan Hess wrote: Why not have a property/instance-variable that controls this directly and then set that in awakeFromNib from one of the controller classes that has an outlet to each of the table views? If you needed a fully scalable so

NSTextView re-implementing word wrapping

2009-04-26 Thread Ryan Joseph
After reading through the archives I learned how to turn off word wrapping in NSTextView by calling a few methods in both NSText and NSTextContainer but calling them in reverse order (reverting the effect) did not restore word wrapping properly. In particular I think the problem is setConta

Re: figuring out which TableView I am?

2009-04-26 Thread Greg Guerin
Jonathan Hess wrote: Why not have a property/instance-variable that controls this directly and then set that in awakeFromNib from one of the controller classes that has an outlet to each of the table views? If you needed a fully scalable solution with support for arbitrary properties, tha

Re: figuring out which TableView I am?

2009-04-26 Thread Graham Cox
On 27/04/2009, at 9:31 AM, Jim Correia wrote: I want table 1 to have a blue background, so I set its tag to 3. I want table 2 to also have a blue background, so I set its tag to 3. I want table 1 to have red text. Switch off tag, 3 == red text. I want table 2 to have green text. Oops - tag 3 a

Re: figuring out which TableView I am?

2009-04-26 Thread Jim Correia
On Sun, Apr 26, 2009 at 7:05 PM, WT wrote: > More importantly, perhaps, is the fact that adding property/ivars is not a > scalable solution in that it requires adding more code in several places if > more tables are added. The tags solution only requires some fiddling with IB > and updating a swi

Core Data Suddenly Losing Changes

2009-04-26 Thread Walker Argendeli
I've been working on a project that uses Core Data for a while now. I recently changed the model and ran it, but I noticed an odd behavior: I wan't informed that the model had changed and was incompatible. I went ahead and deleted the old xml file and when running the application again, i

Re: figuring out which TableView I am?

2009-04-26 Thread WT
NSControl is hardly a distant superclass. It's the immediate superclass of NSTableView. Also, why do something more complicated when there's an easy, built-in, and fully supported solution already in place, namely, tags? If it's not obvious or expected, it's only because not enough people

Re: figuring out which TableView I am?

2009-04-26 Thread Jonathan Hess
Why not have a property/instance-variable that controls this directly and then set that in awakeFromNib from one of the controller classes that has an outlet to each of the table views? If I maintained your project after you, the tag variable inherited from a distant superclass would not be

Re: NSPopUpButtonCell Keeps on Trackin'! Demo, Movie

2009-04-26 Thread Jim Correia
On Sun, Apr 26, 2009 at 10:41 AM, Jerry Krinock wrote: > // Table View delegate method. > // A little more complicated since we have to dig into the > // parts of the table, and assign it as a header cell. > - (void)               tableView:(NSTableView*)tableView >  mouseDownInHeaderOfTableColum

Drawing Across NSTableView Columns

2009-04-26 Thread K. Darcy Otto
I'm attempting to model a real-world table structure with an NSTableView. Here is what the table structure might look like on paper (warning: ASCII art ahead): 1. | A 2. || B 3. |||C 4. D 5. E 6. F Between the number and the letters are a series of (unbroke

Re: Why is NSString->FSRef so hard?

2009-04-26 Thread Sean McBride
Erg Consultant (erg_consult...@yahoo.com) on 2009-04-25 7:33 PM said: >Isn't there some easy way to get an FSRef from an NSString that is a >path containing special characters? You can use NDAlias: It provides an NSString category that converts t

Re: Clicking through a NSView with CALayers

2009-04-26 Thread Rowan Nairn
Thanks for the pointers. I actually figured out a way to do it. If you [NSView setWantsLayer:NO] and render the layer yourself like so. - (void)drawRect:(NSRect)dirty { CGContextRef ctx = [[NSGraphicsContext currentContext] graphicsPort]; CGContextClipToRect(ctx, NSRectToCGRe

Query regarding cursor change

2009-04-26 Thread Deepa
Hi, I am developing an application for Leopard which is similar to the feature 'Open a part of this page in Dashboard' in Safari. In addition to this, I also want to change the cursor when it enters specific area. I have added a transparent window as a child of my Main Window and am han

Strange NSShadow behaviour in overlapping NSVie ws—bug?

2009-04-26 Thread Benjamin Dobson
Hello all, I've subclassed NSButtonCell to provide custom drawing. This includes an NSShadow. All drawing is done inside the cell's bounds. As I want this to work easily in IB with minimum work, I've based it on the "Push" button style. This means the clickable button area is considerably

Re: FSPathCopyObjectSync and symbolic links?

2009-04-26 Thread Iceberg-Dev
On Apr 26, 2009, at 4:05 PM, Michael Hall wrote: On Apr 26, 2009, at 8:22 AM, Iceberg-Dev wrote: Is it possible to copy a symbolic link (the symbolic link file and not the item it references) using the FSPathCopyObjectSync API? No valuable info was found in the documentation, the list arc

Re: Nested AutoRelease Pools Crash

2009-04-26 Thread Trygve Inda
> Trygve Inda wrote: > >> Sorry - what I thought were irrelevant parts were partly removed to >> keep the >> email line wrap nice. I'll try to narrow it down some more. > > > Instead of narrowing it down only for emailing, you might actually > refactor it so the main loop looks more like the par

Re: ObjectAlloc and objects that should have been released

2009-04-26 Thread Miles
Wow. In that particular example it was '[UIScreen mainScreen] applicationFrame' that was causing the problem. When I changed that to a CGRectMake, the view was not longer living once I released it. Does '[UIScreen mainScreen] applicationFrame' cause some sort of caching issue? Now I'm at a point w

Re: Clicking through a NSView with CALayers

2009-04-26 Thread Bill Cheeseman
On Apr 26, 2009, at 2:09 PM, Rowan Nairn wrote: So the little detail is this: I don't want to make my whole window transparent to mouse events. There are bits of my window on which I want to detect clicks. Those are the bits that I've drawn on. I want the bits I haven't drawn on, the visuall

Re: Nested AutoRelease Pools Crash

2009-04-26 Thread Greg Guerin
Trygve Inda wrote: Sorry - what I thought were irrelevant parts were partly removed to keep the email line wrap nice. I'll try to narrow it down some more. Instead of narrowing it down only for emailing, you might actually refactor it so the main loop looks more like the paraphrase you

Re: NSTask, or threading?

2009-04-26 Thread Richard Frith-Macdonald
On 26 Apr 2009, at 18:39, James Maxwell wrote: So, how can I put my dataThing into some process, thread, etc., in a way that keeps it totally in its "own world", so to speak? There is a simple an easy way to keep it in a separate thread ... so that's probably what you want to do. You woul

Re: ObjectAlloc and objects that should have been released

2009-04-26 Thread Miles
I've narrowed this down to the smallest case I can. I have a method that loads a view and immediately releases it: UIWindow *win= [UIApplication sharedApplication].keyWindow; TestVC *test = [[TestVC alloc] init]; [win addSubview:test.view]; [test.view removeFro

Re: NSTask, or threading?

2009-04-26 Thread Ken Thomases
On Apr 26, 2009, at 12:39 PM, James Maxwell wrote: I guess what's not clear to me about NSTask is how to use it for something that *isn't* already a "program" - everything I'm finding about NSTask seems to imply that the task is a separate program (every tutorial seems to be about wrapping

Re: NSTask, or threading?

2009-04-26 Thread Joseph Kelly
You'll most likely want to put your MIDI stuff on a worker thread, and add synchronization around any data that could possibly be shared between threads. http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html It's non-trivial work if you are u

Re: Clicking through a NSView with CALayers

2009-04-26 Thread Rowan Nairn
On Sun, Apr 26, 2009 at 3:08 AM, Bill Cheeseman wrote: > Making the window invisible isn't relevant -- visual transparency and > clickthrough are two different qualities. To make a window transparent to > mouse events, you have to call -[NSWindow setIgnoresMouseEvents:YES]. Note > that the entire

Re: parsing a string into words

2009-04-26 Thread Jeffrey Oleander
At Sun, 2009-04-26, 09:01, Alastair Houghton wrote: >> At 2009 Apr 26, 04:33, Jeffrey Oleander wrote: >> NSArray * tokens = [string >> componentsSeparatedByCharactersInSet: >> whitespaceCharacterSet]; > No, no, no.  If you read Gerriet's original post, > you would have noticed that he even expl

Re: Nested AutoRelease Pools Crash

2009-04-26 Thread Trygve Inda
>> - (void)threadMethod:(id)anObject >> { >>   NSAutoreleasePool* outterPool = [[NSAutoreleasePool alloc] init]; >> >>   NSDictionary*    userDefaults = [NSUserDefaults standardUserDefaults] >>   importantValue = [[userDefaults objectForKey:@"myKey"] boolValue]; > > +standardUserDefaults don't re

Re: Nested AutoRelease Pools Crash

2009-04-26 Thread Trygve Inda
> 2009/4/26 Trygve Inda : >> - (void)threadMethod:(id)anObject >> { >>   NSAutoreleasePool* outterPool = [[NSAutoreleasePool alloc] init]; >> >>   NSDictionary*    userDefaults = [NSUserDefaults standardUserDefaults] >>   importantValue = [[userDefaults objectForKey:@"myKey"] boolValue]; >> >>  

NSTask, or threading?

2009-04-26 Thread James Maxwell
Hello All, My current project uses something like a database - it's not a database, but the idea is that it both stores knowledge, and "searches" its stored knowledge during runtime. I'll call this database-like entity the "dataThing"... The dataThing is complex - lots of calculations goi

Re: Getting the message text of a mail

2009-04-26 Thread Nicko van Someren
Without wanting to discuss undocumented APIs, you might want to Google 'GPGMail' as an example of a plug-in for Mail.app which adds support for using the Open Source GPG mail encryption code. The plug-in makes a fairly good stab at being compatible across a number of versions of Mail.app a

Re: Nested AutoRelease Pools Crash

2009-04-26 Thread Dave Keck
> - (void)threadMethod:(id)anObject > { >   NSAutoreleasePool* outterPool = [[NSAutoreleasePool alloc] init]; > >   NSDictionary*    userDefaults = [NSUserDefaults standardUserDefaults] >   importantValue = [[userDefaults objectForKey:@"myKey"] boolValue]; +standardUserDefaults don't return no dic

Re: Nested AutoRelease Pools Crash

2009-04-26 Thread Michael Ash
2009/4/26 Trygve Inda : > - (void)threadMethod:(id)anObject > { >   NSAutoreleasePool* outterPool = [[NSAutoreleasePool alloc] init]; > >   NSDictionary*    userDefaults = [NSUserDefaults standardUserDefaults] >   importantValue = [[userDefaults objectForKey:@"myKey"] boolValue]; > >    while (1) >

Re: Nested AutoRelease Pools Crash

2009-04-26 Thread Clark Cox
2009/4/26 Trygve Inda : >> - (void)threadMethod:(id)anObject >> { >>    NSAutoreleasePool* outterPool = [[NSAutoreleasePool alloc] init]; >> >>    NSDictionary*    userDefaults = [NSUserDefaults standardUserDefaults] >>    importantValue = [[userDefaults objectForKey:@"myKey"] boolValue]; >> >>    

Re: Nested AutoRelease Pools Crash

2009-04-26 Thread Trygve Inda
> - (void)threadMethod:(id)anObject > { >NSAutoreleasePool* outterPool = [[NSAutoreleasePool alloc] init]; > >NSDictionary*userDefaults = [NSUserDefaults standardUserDefaults] >importantValue = [[userDefaults objectForKey:@"myKey"] boolValue]; > > while (1) > { >

Nested AutoRelease Pools Crash

2009-04-26 Thread Trygve Inda
- (void)threadMethod:(id)anObject { NSAutoreleasePool* outterPool = [[NSAutoreleasePool alloc] init]; NSDictionary*userDefaults = [NSUserDefaults standardUserDefaults] importantValue = [[userDefaults objectForKey:@"myKey"] boolValue]; while (1) { NSAutorelease

Re: Trying to get flagsChanged: to work

2009-04-26 Thread Mike Abdullah
On 25 Apr 2009, at 9:07PM, Sean McBride wrote: Dave DeLong (davedel...@me.com) on 2009-04-25 1:46 PM said: Interesting. Coming from the world of iPhone dev, this seems wrong to me. On the iPhone, a view's controller is in the chain by default. NSViewController was added in 10.5. Perhap

Re: NSPopUpButtonCell Keeps on Trackin'! Demo, Movie

2009-04-26 Thread Jerry Krinock
Well, even after distilling into a tiny demo, I still can't figure this one out. A popup menu attached to a regular button works fine. But when using it as an NSTableHeaderCell, it keeps tracking the mouse even after it's closed. How can one work around this? Here's a 30-second movie:

Re: FSPathCopyObjectSync and symbolic links?

2009-04-26 Thread Michael Hall
On Apr 26, 2009, at 8:22 AM, Iceberg-Dev wrote: Is it possible to copy a symbolic link (the symbolic link file and not the item it references) using the FSPathCopyObjectSync API? No valuable info was found in the documentation, the list archive, google results. The File Manager Reference

Re: parsing a string into words

2009-04-26 Thread Alastair Houghton
On 26 Apr 2009, at 04:33, Jeffrey Oleander wrote: NSArray * tokens = [string componentsSeparatedByCharactersInSet: whitespaceCharacterSet]; No, no, no. If you read Gerriet's original post, you would have noticed that he even explained that what you just said won't work, because not all l

Re: Multiple cell in a table column

2009-04-26 Thread Jerry Krinock
On 2009 Apr 25, at 20:17, Arun wrote: Is it possible to have multiple Cells in a single table column? No. I need to have NSTextFiledCell and NSPopUpButtonCell in a single table column. Same answer I gave you yesterday when you wanted an text + image. Subclass NSCell again, or reconsid

FSPathCopyObjectSync and symbolic links?

2009-04-26 Thread Iceberg-Dev
Is it possible to copy a symbolic link (the symbolic link file and not the item it references) using the FSPathCopyObjectSync API? No valuable info was found in the documentation, the list archive, google results. ___ Cocoa-dev mailing list (Coc

Re: NSString may not respond to a method in documentation?

2009-04-26 Thread Mr. Gecko
Oh ok, thanks. On Apr 26, 2009, at 8:08 AM, Dave Geering wrote: I think this is weird because componentsSeparatedByCharactersInSet is in the documentation for NSString It still works, but I don't know why xcode would give me this warning. This method was added in Mac OS 10.5, so if you're

Re: NSString may not respond to a method in documentation?

2009-04-26 Thread Dave Geering
> I think this is weird because componentsSeparatedByCharactersInSet is in the > documentation for NSString It still works, but I don't know why xcode would > give me this warning. This method was added in Mac OS 10.5, so if you're using the Cocoa framework from the 10.4 SDK you will get that warn

Strange error message when trying to print

2009-04-26 Thread Peter Hudson
When I try to print a document ( to PDF ) the app can sometimes hang - and I get a long message which looks like debug printout from the OS in the debug console. The last section of the message seems to contain the crux of the problem : - Sun Apr 26 12:42:51 peter-hudsons-macbook-pro.lo

NSString may not respond to a method in documentation?

2009-04-26 Thread Mr. Gecko
Hello, I'm having a weird warning about NSString and I have no idea why it's happening, maybe you could tell me why? This is my code. NSString *string = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; NSArray *components = [string componentsSeparatedByCharact

Re: Clicking through a NSView with CALayers

2009-04-26 Thread Bill Cheeseman
On Apr 25, 2009, at 10:08 PM, Rowan Nairn wrote: On Sat, 25 Apr 2009 at 17:26 AM, Bill Cheeseman wrote: I have an identical setup on an application I'm currently working on, and clickthrough works just fine for me. Really? I hope we're talking about the same thing here. I just created a n

Re: Coca equivalent to NMInstall?

2009-04-26 Thread Dave Keck
> It's not Cocoa, but CFUserNotificiation is probably the closest in spirit to > NMInstall.  I don't know if the notification dialog persists if your process > exits. It does. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post ad

Re: Coca equivalent to NMInstall?

2009-04-26 Thread Ken Thomases
On Apr 26, 2009, at 2:52 AM, Trygve Inda wrote: Is there an equivalent to NMInstall in Cocoa? I want to be able to post an error message to the OSW and then immediately quit, but still have my message show up to the user. This is from a faceless background application. It's not Cocoa, but

Coca equivalent to NMInstall?

2009-04-26 Thread Trygve Inda
Is there an equivalent to NMInstall in Cocoa? I want to be able to post an error message to the OSW and then immediately quit, but still have my message show up to the user. This is from a faceless background application. Thanks, Trygve ___ Cocoa-dev

Re: Editable PopUpButtons

2009-04-26 Thread Quincey Morris
On Apr 26, 2009, at 00:07, Jerry Krinock wrote: On 2009 Apr 25, at 20:18, Arun wrote: Is the any control which is similar to NSPopUpButtonCell but still editable? I presume you mean NSPopUpButton, which is a control that wraps NSPopUpButtonCell which is a cell. Look at "NSComboBox". To

Re: Editable PopUpButtons

2009-04-26 Thread Jerry Krinock
On 2009 Apr 25, at 20:18, Arun wrote: Is the any control which is similar to NSPopUpButtonCell but still editable? I presume you mean NSPopUpButton, which is a control that wraps NSPopUpButtonCell which is a cell. Look at "NSComboBox". Too bad someone couldn't have thunk up a better nam

Re: Editable PopUpButtons

2009-04-26 Thread Benjamin Dobson
On 26 Apr 2009, at 04:18:56, Arun wrote: Hi Is the any control which is similar to NSPopUpButtonCell but still editable? Thanks Arun KA NSComboBox. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mo