Re: NSDivideRect and 64-bit

2009-09-06 Thread James W. Walker
On Sep 6, 2009, at 12:28 PM, Mitchell Livingston wrote: Under NSRectEdge in the documentation. For example: "NSMinXEdge Specifies the left edge of the input rectangle. The input rectangle is divided vertically, and the leftmost rectangle with the width of amount is placed in slice. Avail

Re: Drawing NSImageView Over NSOpenGLview

2009-10-10 Thread James W. Walker
On Oct 10, 2009, at 1:26 PM, Steven Yiqiang Nie wrote: I'm new into opengl development on mac. Currently, I'm looking for a way to draw a NSImageView over NSOpenglView. I googled it, and it seems like I need to put the opengl thing into layer. I don't understand this, Could someone explain

Re: ATTR_CMN_CHGTIME

2010-03-21 Thread James W. Walker
On Mar 21, 2010, at 4:20 PM, Ron Fleckner wrote: > On 22/03/2010, at 10:01 AM, gMail.com wrote: > >> Hi, >> I cannot find a Cocoa API to set the "Attribute Modification Date" of a >> file. If there is a way, may you please let me know? >> >> In the meantime, on MacOS X 10.5.8, I have been tryin

Knowing when control tracking is done

2010-03-21 Thread James W. Walker
I have an instance of NSSlider that I've marked as "continuous", but I also need to know when the user has released the mouse button and stopped messing with the slider. Do I need to subclass NSSlider and override mouseUp:, or is there a better way?

Re: Knowing when control tracking is done

2010-03-22 Thread James W. Walker
On Mar 21, 2010, at 11:27 PM, James W. Walker wrote: > I have an instance of NSSlider that I've marked as "continuous", but I also > need to know when the user has released the mouse button and stopped messing > with the slider. Do I need to subclass NSSlider and

NSTask and pseudo TTY

2010-03-28 Thread James W. Walker
I've been running NSTask and reading the output using -[NSFileHandle readInBackgroundAndNotify], but in certain situations there was a problem: Due to the block buffering of standard output, I wasn't getting notified as soon as some output had been produced. I don't have control over the code

Re: NSTask and pseudo TTY

2010-03-28 Thread James W. Walker
? As I mentioned, I don't have source code for the tool. > On Mar 28, 2010, at 12:56 PM, James W. Walker wrote: > >> I've been running NSTask and reading the output using -[NSFileHandle >> readInBackgroundAndNotify], but in certain situations there was a proble

Re: NSTask and pseudo TTY

2010-03-28 Thread James W. Walker
On Mar 28, 2010, at 2:29 PM, Ken Thomases wrote: > On Mar 28, 2010, at 1:56 PM, James W. Walker wrote: > >> I've been running NSTask and reading the output using -[NSFileHandle >> readInBackgroundAndNotify], but in certain situations there was a problem: >>

Re: showing a list of mounted volumes with icon

2010-04-24 Thread James W. Walker
On Apr 24, 2010, at 7:53 AM, Angelo Chen wrote: > NavCreateChooseVolumeDialog will do, thanks. I was trying to find a sample > code that uses the function in the net, but none so far, any idea where I can > find a sample code for this function? No, but all the NavCreate... functions work prett

Re: NSMovieView -> QTMovieView; rate problems...

2010-05-22 Thread James W. Walker
On May 22, 2010, at 1:26 PM, Matthew Weinstein wrote: > One important aspect of my app is teh ability to speed and slow audio (and > video playback). On the old NSMovieview this worked like an analog tape > machine: if you used NSMovieview setRate: it would slow the sound down > smoothly but m

Re: Boolean Values in a plist

2010-05-23 Thread James W. Walker
On May 23, 2010, at 8:23 PM, Dale Miller wrote: > I need to use the parameters obtained from a plist (via > NSPropertyListSerialization). I can get the process to work quite well, > except that I have to use in my code an undocumented class: NSCFBoolean. > Determining that the returned object i

Re: How tell tell if an NSNumber was initialized from a float or int?

2010-06-26 Thread James W. Walker
On Jun 26, 2010, at 11:51 AM, Quincey Morris wrote: > 1. Unless this has changed recently, [NSNumber numberWithInt: 1] and > [NSNumber numberWithBool: YES] both return the same (singleton) object, as do > [NSNumber numberWithInt: 0] and [NSNumber numberWithBool: NO]. This is not true in Snow L

access violation after using NSTask

2010-01-01 Thread James W. Walker
I understand that one advantage of using a task rather than a thread is a task can crash without taking down the main app. I decided to try that. I made a little command-line program that deliberately crashes by infinite recursion, and a Cocoa app that runs it using NSTask. The problem is tha

Re: access violation after using NSTask

2010-01-01 Thread James W. Walker
On Jan 1, 2010, at 6:04 PM, Ken Thomases wrote: > Try turning off "Auto-attach debugger on crash" in the executable's settings > (the "executable" in the sense of Xcode's representation of your app's > executable, in its project). > > I believe that Xcode may actually be attaching to the child

Re: problems loading a sound with NSSound

2010-03-07 Thread James W. Walker
On Mar 7, 2010, at 8:26 PM, Jonathan Chacón wrote: > I added a sound file to the resources of my project ( logoSound.AIF ) > > I use this function to load the resource: > > -(NSSound*) getSound:(NSString *) sndValue { > NSBundle *bundle = [ NSBundle bundleForClass: [ self class ] ]; >

Re: my drawer won't close

2009-06-20 Thread James W. Walker
On Jun 19, 2009, at 12:19 PM, James Walker wrote: I set up a drawer in IB, with an NSScrollView containing an NSTextView as my content view. I open it programmatically, and it looks fine. But when I try to close the drawer using the mouse, it just beeps. With a bit more thought, it's f

Re: Trouble with event taps...

2009-08-10 Thread James W. Walker
On Aug 9, 2009, at 3:15 PM, Nat Burke wrote: I have posted my event tap creation code below - I've searched all over the mailing list and the net to see if I could find a solution, but I am genuinely stuck. Any help is greatly appreciated! // Create an event tap. eventMask = CGEvent

sorting an NSTableView

2008-05-29 Thread James W. Walker
Hi. I'm a Cocoa newbie, and I'm trying to figure out how to enable sorting columns of my table, but the NSTableView guide doesn't say anything about it. I see that NSTableView has a setSortDescriptors method, NSTableColumn has a setSortDescriptorPrototype method, and that IB shows a "sort

Re: sorting an NSTableView

2008-05-31 Thread James W. Walker
7;d have more work to do. On Fri, May 30, 2008 at 12:18 PM, James W. Walker <[EMAIL PROTECTED]> wrote: Hi. I'm a Cocoa newbie, and I'm trying to figure out how to enable sorting columns of my table, but the NSTableView guide doesn't say anything about it. I see

crash on command-W

2008-06-09 Thread James W. Walker
I'm getting an access violation (inside NSTableView) when I close a window by command-W but not when I close it by clicking the close widget. I don't understand why it would make a difference. I have a nib containing a window and an NSWindowController subclass. It's not a document-based a

Re: crash on command-W

2008-06-09 Thread James W. Walker
On Jun 9, 2008, at 9:18 PM, Andrew Farmer wrote: On 09 Jun 08, at 21:03, James W. Walker wrote: I'm getting an access violation (inside NSTableView) when I close a window by command-W but not when I close it by clicking the close widget. I don't understand why it would make a

Re: crash on command-W

2008-06-09 Thread James W. Walker
ix, I verified with Instruments that windows aren't leaking.) On Jun 9, 2008, at 10:30 PM, James W. Walker wrote: On Jun 9, 2008, at 9:18 PM, Andrew Farmer wrote: On 09 Jun 08, at 21:03, James W. Walker wrote: I'm getting an access violation (inside NSTableView) when I clos

Re: crash on command-W

2008-06-10 Thread James W. Walker
On Jun 10, 2008, at 7:24 AM, Adam R. Maxwell wrote: On Jun 9, 2008, at 10:30 PM, James W. Walker wrote: On Jun 9, 2008, at 9:18 PM, Andrew Farmer wrote: On 09 Jun 08, at 21:03, James W. Walker wrote: OK, I turned on NSZombieEnabled, and now I get this in the log: *** -[LogController

How can an object know when another object has gone away?

2008-06-15 Thread James W. Walker
Is there a standard Cocoa design pattern or idiom to have an object find out when another object has been destroyed? In PowerPlant, I'd use LBroadcaster and LListener, with the listener listening for msg_BroadcasterDied. Here's my specific situation. I have several controllers that can

Re: How can an object know when another object has gone away?

2008-06-15 Thread James W. Walker
On Jun 15, 2008, at 3:25 PM, Andreas Monitzer wrote: On Jun 16, 2008, at 00:20, James W. Walker wrote: Is there a standard Cocoa design pattern or idiom to have an object find out when another object has been destroyed? In PowerPlant, I'd use LBroadcaster and LListener, with the lis

Re: How can an object know when another object has gone away?

2008-06-15 Thread James W. Walker
On Jun 15, 2008, at 4:04 PM, Hamish Allan wrote: On Sun, Jun 15, 2008 at 11:20 PM, James W. Walker <[EMAIL PROTECTED]> wrote: Here's my specific situation. I have several controllers that can create tasks, using an NSTask wrapper based on the Moriarty sample. When a task co

NSUserDefaultsController, when does value change?

2008-07-13 Thread James W. Walker
I have a preferences dialog that I'm using with an NSUserDefaultsController instance, my first use of bindings, and it works. But I want to post a notification when a certain setting changes. In my method that shows the dialog, I record the old value of the setting. In my action method f

Re: NSUserDefaultsController, when does value change?

2008-07-14 Thread James W. Walker
On Jul 14, 2008, at 9:34 AM, Matt Neuburg wrote: On Sun, 13 Jul 2008 21:29:56 -0700, "James W. Walker" <[EMAIL PROTECTED] > said: I have a preferences dialog that I'm using with an NSUserDefaultsController instance, my first use of bindings, and it works. But I want t

Design question, which controller class to use

2008-07-20 Thread James W. Walker
I have these windows, each of which has a table displaying data from an array of dictionaries. The data is never stored on disk, so I don't think of these windows as "documents". Since there is a window (which has a title that depends on the data) I thought I should use a subclass of NSWi

highlighted table column in nib

2008-07-26 Thread James W. Walker
When designing an NSTableView in IB, I can highlight one of the columns. That information is clearly stored in the file, because if I close and reopen, the highlight is still there. But after I load the nib, [myTable highlightedTableColumn] returns nil. Is there any way to get that nib-

Updating table rows with bindings

2008-07-31 Thread James W. Walker
When an NSTableView is set up with bindings and NSArrayController, what is the right way to modify a row? I see NSArrayController methods to add and remove objects, but nothing to modify one. I guess I could remove and then add, but that seems ugly. Before I started with bindings, it wasn

Re: Updating table rows with bindings

2008-07-31 Thread James W. Walker
On Jul 31, 2008, at 8:21 AM, Keary Suska wrote: If [[ arrayController arrangedObjects] objectAtIndex: i ] I returning an immutable object, it's because that is what you are putting into arrayController 's content array. Use mutable dictionaries instead. I was mistaken, it is mutable. I was

Re: HFS Path To POSIX Path

2008-09-01 Thread James W. Walker
On Sep 1, 2008, at 5:27 PM, J. Todd Slack wrote: What is the proper way to convert an HFS Path to a POSIX path? So take: Husband:Users:slack:Music:iTunes:iTunes Music:Adult:Resucitation:03 - Minors at night.mp3 and convert to: /Users/slack/Music/iTunes:/Tunes Music/Adult/ Resucitation/03

Re: NSTask with ssh-agent

2008-12-14 Thread James W. Walker
On Dec 13, 2008, at 5:51 PM, James W. Walker wrote: I'm using NSTask to run Mercurial, which internally uses ssh to communicate with a server. It works when there is no pass phrase on the private key, but what if there is one? I've heard that Leopard has a built-in ssh-

Re: How do I include a URL in a preprocessed Info.plist?

2008-12-27 Thread James W. Walker
On Dec 27, 2008, at 7:22 AM, Graham Cox wrote: I'm preprocessing my info.plist file so I can automatically update it with version number, etc. I want to include a URL in my plist (to support Sparkle) but Xcode won't let me. If I include the URL directly, it causes an error (xml parse err

Re: string bounding rect methods

2009-01-17 Thread James W. Walker
On Jan 16, 2009, at 8:12 PM, Aki Inoue wrote: Yes, rendering and measuring methods behave the same. Please file a doc enhancement request. Thanks for confirming my guess. I used the documentation feedback form. On 2009/01/16, at 19:11, James Walker wrote: The documentation for -[NSStrin

Re: Direct use of NSScroller?

2008-10-02 Thread James W. Walker
On Oct 2, 2008, at 8:13 AM, Michael Ash wrote: On Wed, Oct 1, 2008 at 10:13 PM, James Walker <[EMAIL PROTECTED]> wrote: I suppose someone is sure to ask why I can't use NSScrollView. I'm doing a kind of scrolling that isn't just shifting a view around. Some members are arranged in two r

Re: Direct use of NSScroller?

2008-10-02 Thread James W. Walker
On Oct 1, 2008, at 8:53 PM, Clark Cox wrote: On Wed, Oct 1, 2008 at 7:13 PM, James Walker <[EMAIL PROTECTED]> wrote: Is it possible to use a scroller without a scroll view? The first problem is that IB won't let me create an NSScroller that is not embedded in an NSScrollView. Just inst

Re: NSWindowController retain count confusion

2008-10-05 Thread James W. Walker
On Sep 30, 2008, at 6:06 PM, Jonathan Hess wrote: Interesting. Was there a corresponding console message about an object being autoreleased with no pool in place? If not, you should consider filing a radar with a small reproducible test case. In case you or any other Apple folks are intere

drawing centered text in a box

2008-10-11 Thread James W. Walker
When using the NSString or NSAttributedString methods for drawing text in a box, such as -[NSAttributedString drawWithRect:options:], is there any way to make the lines of text horizontally centered? smime.p7s Description: S/MIME cryptographic signature

Re: drawing centered text in a box

2008-10-11 Thread James W. Walker
On Oct 11, 2008, at 10:00 AM, Ricky Sharp wrote: On Oct 11, 2008, at 11:27 AM, James W. Walker wrote: When using the NSString or NSAttributedString methods for drawing text in a box, such as -[NSAttributedString drawWithRect:options:], is there any way to make the lines of text

Re: Inviting to comment on Cocoa categories

2008-11-10 Thread James W. Walker
On Nov 10, 2008, at 2:40 AM, Kyle Sluder wrote: If I remember correctly, matrix multiplication does not distribute over matrix addition, and since a transformation matrix stack is essentially a product of sums, the API designers might, as you suggest, have simply left the functionality out for

Re: Keystrokes for non-ascii letters

2008-11-29 Thread James W. Walker
On Nov 29, 2008, at 10:48 AM, Dave DeLong wrote: My goal now is to accept arbitrary strings and post the keyboard events for them. For ASCII characters, I can easily dispatch a CGEventRef. However, I want to be able to send non-ascii characters as well. Basically, any character that's v

Re: Keystrokes for non-ascii letters

2008-11-29 Thread James W. Walker
r more information on CGEventKeyboardSetUnicodeString, but have found nothing helpful. It didn't actually work for both Cocoa and Carbon apps until some recent update of Leopard, so probably nobody has been using it. On 29 Nov, 2008, at 1:27 PM, James W. Walker wrote: Eric Schlegel a

NSTask with ssh-agent

2008-12-13 Thread James W. Walker
I'm using NSTask to run Mercurial, which internally uses ssh to communicate with a server. It works when there is no pass phrase on the private key, but what if there is one? I've heard that Leopard has a built-in ssh-agent that integrates with the Keychain, but I don't understand how to

Re: stopping an application

2009-04-12 Thread James W. Walker
On Apr 12, 2009, at 8:55 PM, Greg Guerin wrote: Bill Janssen wrote: I was afraid of that... Is there an easy way to do that from the command line given its PID? Use the osascript command. Form a query using a 'whose' clause to select the process ID. I forget what the exact wording is,