NSGraphicsContext PDF crash

2011-01-03 Thread Wesley Smith
I'm trying to figure out why I get a crash when drawing to a PDF CG context. From what I can tell, some resources are either corrupt or missing, but it's not easy to tell from the docs since I'm doing nothing complex and following the sample code on the apple website. All of this code lives in a

Re: NSGraphicsContext PDF crash

2011-01-03 Thread Wesley Smith
Are you sure this crash corresponds to your code? It looks like this is crashing when Cocoa tries to draw a window border, but the lowest-level frames are PDF-related. Are you perhaps allowing the NSGraphicsContext to outlive the CGPDFGraphicsContext it references? I wish that were the

Re: NSGraphicsContext PDF crash

2011-01-03 Thread Wesley Smith
NSBezierPath *p = [[NSBezierPath bezierPath] retain]; [p lineToPoint:NSMakePoint(100, 100)];  // - crashes here The 'crash' presumably is an exception stating 'no current point for operation' or words to that effect. You can't do a lineToPoint as the first op in a bezier

Re: NSGraphicsContext PDF crash

2011-01-03 Thread Wesley Smith
Also, the other thing that was messing things up and making it look like the problem was in window drawing is that I wasn't saving the previous NSGraphicsState before setting my PDF one to the current, so that when I call restore, things are corrupted. wes

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

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 je...@ieee.org 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

tab view look

2010-01-26 Thread Wesley Smith
I've been looking around for examples on how to get tab view too look like they do on Terminal, Safari, etc. Is there any example code around? I've not found any or really any references as to how to provide a custom look to tabs. thanks, wes ___

Re: tab view look

2010-01-26 Thread Wesley Smith
thanks~ this looks like exactly what I was looking for. wes On Tue, Jan 26, 2010 at 2:24 PM, Dave DeLong davedel...@me.com wrote: http://www.positivespinmedia.com/dev/PSMTabBarControl.html Cheers, Dave On Jan 26, 2010, at 3:23 PM, Wesley Smith wrote: I've been looking around for examples

NSPanel and mouse input / activation

2009-07-17 Thread Wesley Smith
Hi, I have an NSPanel window in my app that I'm putting an OpenGL context in. I want the panel to receive mouse drag events without having to first click on the panel to activate it. I've not been able to find any info on how to do this in the docs or through many google searches. Currently, if

Re: NSPanel and mouse input / activation

2009-07-17 Thread Wesley Smith
thanks! that did the trick. best, wes On Fri, Jul 17, 2009 at 1:31 PM, I. Savantidiotsavant2...@gmail.com wrote: On Jul 17, 2009, at 4:28 PM, Wesley Smith wrote: Currently, if I click on the panel, it gets activated and then I can drag the mouse around.  How does one skip the activation

modifier key query

2008-12-26 Thread Wesley Smith
Is there a way to know if a modifier key (shift, ctrl, option, cmd, etc) is pressed? Obviously, there's this: NSUInteger modifierFlags = [theEvent modifierFlags]; but what if you need to know this information independent of an NSEvent? Anyway to get it? So far I haven't seen anything

Re: modifier key query

2008-12-26 Thread Wesley Smith
Given that you are informed with an event each time the modifiers change, I'm not sure why you want to know this information independent of an NSEvent. Mainly because I'd like to be able to control various animating behaviors via key modifiers but if the user isn't generating new mouse or

Re: modifier key query

2008-12-26 Thread Wesley Smith
Thanks, works like a charm. wes On Fri, Dec 26, 2008 at 5:10 AM, Ron Fleckner ronfleck...@ozemail.com.au wrote: On 26/12/2008, at 7:23 PM, Wesley Smith wrote: Mainly because I'd like to be able to control various animating behaviors via key modifiers but if the user isn't generating new

NSTimer in main NSRunLoop v. InstallEventLoopTimer

2008-09-10 Thread Wesley Smith
Hi, I'm trying to figure out how I can have my app run a timer that never suspends when the user interacts with menus and the like. In Carbon, one can do: EventLoopRef mainLoop; EventLoopTimerUPP timerUPP; EventLoopTimerRef theTimer; mainLoop = GetMainEventLoop();

Re: NSTimer in main NSRunLoop v. InstallEventLoopTimer

2008-09-10 Thread Wesley Smith
On Wed, Sep 10, 2008 at 8:04 AM, Ken Thomases [EMAIL PROTECTED] wrote: On Sep 10, 2008, at 4:19 AM, Wesley Smith wrote: I'm trying to figure out how I can have my app run a timer that never suspends when the user interacts with menus and the like. You can use -[NSRunLoop addTimer:forMode

cmd+w and File menu

2008-09-03 Thread Wesley Smith
I have an application where I generate a number of the menus from scripts and runtime. Something I noticed when I replace the File menu defined in the app's MainMenu.nib is that I can no longer use cmd+w to close windows. I'm not totally sure why this is. The application loads scripts, which

Re: cmd+w and File menu

2008-09-03 Thread Wesley Smith
Hi list, I just realized (after all these years) the File-Close Window was in the File menu. Please ignore my previous post. wes On Wed, Sep 3, 2008 at 2:41 PM, Wesley Smith [EMAIL PROTECTED] wrote: I have an application where I generate a number of the menus from scripts and runtime

NSenu and memory ownership

2008-07-25 Thread Wesley Smith
Hi List, I have a question regarding memory ownership and NSMenus. Let's say I have an application with a nib file containing the usual menu items like File, Edit, Window etc. If, during the execution of my app, I swap out the Window menu with another NSMenu object generated during runtime, who

Re: NSenu and memory ownership

2008-07-25 Thread Wesley Smith
Removing a menu with -removeItem: or -removeItemAtIndex: doesn't return anything, and in any case you didn't alloc, copy, or retain anything, so you don't have to worry about releasing anything. While this is true, I'm using - (NSMenuItem *)itemWithTitle:(NSString *)aString to get the item if

Re: delegation strategy

2008-07-11 Thread Wesley Smith
Hi Michael, Thanks for the suggestion. I think you're right. I'll give it a shot. best, wes On Thu, Jul 10, 2008 at 11:32 PM, Michael Ash [EMAIL PROTECTED] wrote: On Wed, Jul 9, 2008 at 11:19 AM, Wesley Smith [EMAIL PROTECTED] wrote: Hi list, I'm trying to provide a particular windowing

delegation strategy

2008-07-10 Thread Wesley Smith
Hi list, I'm trying to provide a particular windowing interface that combines NSWindow and NSPanel. For the most part I'm using a custom subclass of NSWindow that adds a decent amount of functionality. Occasionally, I want to make use of NSPanel (for the NSUtilityWindowMask style flag) and I'd

max # of file handles

2008-04-19 Thread Wesley Smith
I'm trying to debug a Cocoa app that occasionally exceeds the max allowable number of file handles open and I'm wondering if there's a way to query how many are actually open. I haven't found anything in the docs. Does anyone know where I might find a reference to such a function? thanks, wes

recursive dir searching

2008-04-10 Thread Wesley Smith
hi, I've been trying to use NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:dir]; to recursively search for a file in a given directory but am coming across some minor details that I'm not sure what the best way to deal with is. There's a method

Re: enterFullScreenMode trouble

2008-04-08 Thread Wesley Smith
I don't know about NSView, but I was having the same issue with NSWindow and this fixed it: -(BOOL)canBecomeKeyWindow { return YES; } wes On Fri, Apr 4, 2008 at 3:33 PM, [EMAIL PROTECTED] wrote: Thanks for the reply. Actually I read those posts already, that's why I threw out the

Re: setMenuVisible

2008-03-29 Thread Wesley Smith
On Fri, Mar 28, 2008 at 5:05 AM, Uli Kusterer [EMAIL PROTECTED] wrote: On 27.03.2008, at 08:24, Wesley Smith wrote: I'm trying to make an NSWindow that takes up the entire screen including the menu bar but is not actually a fullscreen window. I know this is possible with Carbon, but I