NSTableHeaderView, how to clear title before resetting new title

2010-12-30 Thread Shane
I have an mouseDown:(NSEvent *) where a popup menu button on a column header appears in an NSTableView. My problem is that I can't seem to get the title to clear before it's set w/ the new title. So what I end up with is new title on top of old title. Here's the code I'm using to set the new title

Re: Calculate next occurrence of a NSDate

2010-12-30 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom Jones wrote: > Hello, > I'm trying to calculate next occurrence of a NSDate object. Based on a "Start > Date" ( e.g. 2010-12-10, Friday ) I would like to know the date of the next > Friday occurrence from today ( e.g. 2010-12-30, Thursday ). >

Re: Calculate next occurrence of a NSDate

2010-12-30 Thread Dave Carrigan
On Dec 30, 2010, at 8:03 PM, Tom Jones wrote: > Hello, > I'm trying to calculate next occurrence of a NSDate object. Based on a "Start > Date" ( e.g. 2010-12-10, Friday ) I would like to know the date of the next > Friday occurrence from today ( e.g. 2010-12-30, Thursday ). > > Example: > Star

Calculate next occurrence of a NSDate

2010-12-30 Thread Tom Jones
Hello, I'm trying to calculate next occurrence of a NSDate object. Based on a "Start Date" ( e.g. 2010-12-10, Friday ) I would like to know the date of the next Friday occurrence from today ( e.g. 2010-12-30, Thursday ). Example: StartDate = 2010-12-10 CurrentDate = 2010-12-30 Next Occurrence

Re: how do I put a subview in a superview with color

2010-12-30 Thread John Joyce
On Dec 30, 2010, at 7:44 PM, colo wrote: > On Thu, Dec 30, 2010 at 6:50 PM, aglee wrote: >> On Dec 30, 2010, at 06:13 PM, colo wrote: >> >> I can get it to compile just fine now but I can't get the button to >> show up at all. >> Perhaps I am sending the addSubview to the incorrect place? NSVi

Re: how do I put a subview in a superview with color

2010-12-30 Thread colo
On Thu, Dec 30, 2010 at 6:50 PM, aglee wrote: > On Dec 30, 2010, at 06:13 PM, colo wrote: > > I can get it to compile just fine now but I can't get the button to > show up at all. > Perhaps I am sending the addSubview to the incorrect place? NSView > *superview = [window contentView]; > I thought

Re: how do I put a subview in a superview with color

2010-12-30 Thread aglee
On Dec 30, 2010, at 06:13 PM, colo wrote: I can get it to compile just fine now but I can't get the button to show up at all. Perhaps I am sending the addSubview to the incorrect place? NSView *superview = [window contentView]; I thought contentView was the top. @implementation WVShapesView -(

Re: how do I put a subview in a superview with color

2010-12-30 Thread colo
On Thu, Dec 30, 2010 at 5:32 PM, Alastair Houghton wrote: > On 30 Dec 2010, at 22:22, colo wrote: > >> I was following the Chapter 17 Cocoa programming for osx 3rd ed >> The code is below. >> All I want to do for a working example is draw an NSView subview in >> the superview. >> And give it have

Re: how do I put a subview in a superview with color

2010-12-30 Thread Alastair Houghton
On 30 Dec 2010, at 22:22, colo wrote: > I was following the Chapter 17 Cocoa programming for osx 3rd ed > The code is below. > All I want to do for a working example is draw an NSView subview in > the superview. > And give it have a color and width height. > > I was trying all sorts of things. I

how do I put a subview in a superview with color

2010-12-30 Thread colo
I was following the Chapter 17 Cocoa programming for osx 3rd ed The code is below. All I want to do for a working example is draw an NSView subview in the superview. And give it have a color and width height. I was trying all sorts of things. I can draw NSMakeRects in the drawRect method But I jus

Re: Detecting MouseUp in NSSplitview

2010-12-30 Thread Peter Zegelin
Thanks Graham, Now I get it. Works great. On 30/12/2010, at 10:39 PM, Graham Cox wrote: > > On 30/12/2010, at 8:54 PM, Peter Zegelin wrote: > >> So it looks like NSSplitView is sufficiently different ( ie it has to move a >> divider ) that to get the mouseUp event I would have to hand

Re: track files even if moved

2010-12-30 Thread Wesley Smith
Many thanks for the responses. This helps alot! wes On Thu, Dec 30, 2010 at 11:41 AM, Jerry Krinock wrote: > > On 2010 Dec 30, at 00:39, Wesley Smith wrote: > >> Is there another way to properly track files on 10.5 and above that I'm >> missing? > > Yes, file aliases have been used by the Mac O

Re: track files even if moved

2010-12-30 Thread Jerry Krinock
On 2010 Dec 30, at 00:39, Wesley Smith wrote: > Is there another way to properly track files on 10.5 and above that I'm > missing? Yes, file aliases have been used by the Mac OS for decades. These links will get you started: http://developer.apple.com/library/mac/#documentation/Carbon/Refere

Re: Detecting MouseUp in NSSplitview

2010-12-30 Thread Graham Cox
On 30/12/2010, at 8:54 PM, Peter Zegelin wrote: > So it looks like NSSplitView is sufficiently different ( ie it has to move a > divider ) that to get the mouseUp event I would have to handle the divider > drag myself, which is probably more complicated than it looks. > > Further suggestions w

Re: track files even if moved

2010-12-30 Thread Ken Thomases
On Dec 30, 2010, at 2:39 AM, Wesley Smith wrote: > I was looking at NSFileManager and the low-level file manage docs, > trying to figure out a way to track a file no matter where it gets > moved on the system, even if my app is not running. For example, > let's say my app references a document, b

Re: Detecting MouseUp in NSSplitview

2010-12-30 Thread Peter Zegelin
A bit cryptic but I still can't get it to work. I implemented: - (BOOL)acceptsFirstResponder{ return YES; } - (void)mouseDown:(NSEvent *)theEvent{ } - (void)mouseUp:(NSEvent *)theEvent{ } and my mouseUp *does* get called. However the divider doesn't move. So I added [super mouseDown:

track files even if moved

2010-12-30 Thread Wesley Smith
I was looking at NSFileManager and the low-level file manage docs, trying to figure out a way to track a file no matter where it gets moved on the system, even if my app is not running. For example, let's say my app references a document, but doesn't store a copy of that document. I'd like to gua