Re: Sudden and hard to reproduce crashes in libcache

2012-03-13 Thread Dragan Milić
Just an update on this issue: On čet 23.02.2012., at 20.00, Greg Parker wrote: > Yep, that's CFRelease(NULL), plus ExceptionHandling.framework catching the > Unix signal and trying to turn it into an Objective-C exception. > > That background thread is part of NSCache. This could be a bug in yo

NSMatrix, NSForm - addRow - why above and not below?

2012-03-13 Thread Grandinetti Philip
I'm running into a strange behavior with NSForm (and also NSMatrix). (1) Using interface builder (in Xcode 4.3.1) I place an NSForm in a window. I add a NSButton and wire it to an IBAction that sends addRow to the NSForm. - (IBAction) addRow:(id)sender { [form addRow]; [form sizeToCells];

Re: NSMatrix, NSForm - addRow - why above and not below?

2012-03-13 Thread Keary Suska
On Mar 13, 2012, at 8:55 AM, Grandinetti Philip wrote: > I'm running into a strange behavior with NSForm (and also NSMatrix). > > (1) Using interface builder (in Xcode 4.3.1) I place an NSForm in a window. I > add a NSButton and wire it to an IBAction that sends addRow to the NSForm. > > - (IBA

Re: NSMatrix, NSForm - addRow - why above and not below?

2012-03-13 Thread Fritz Anderson
On 13 Mar 2012, at 12:49 PM, Keary Suska wrote: > It is a bit deceptive, but the problem is not what you think. The row is in > fact added at the bottom, but when the view is resized it is sized from the > bottom left corner, instead of the top left, which is intuitive for humanity > but not ap

Re: NSMatrix, NSForm - addRow - why above and not below?

2012-03-13 Thread Grandinetti Philip
Thanks Keary, It all makes sense.Deceptive is the word "below" in the reference guide, which I usually interpret using the direction of gravity. Philip On Mar 13, 2012, at 1:49 PM, Keary Suska wrote: > On Mar 13, 2012, at 8:55 AM, Grandinetti Philip wrote: > >> I'm running into a strange

Undomanager for custom object?

2012-03-13 Thread Luc Van Bogaert
Hi, In my document-based app, I am using NSDocument's NSUndoManager to implement undo/redo. As part of my document objects, I have to deal with a custom object, for which I would also like to implement undo/redo. I know NSResponder has undo/redo features, but how should I implement this for a c

Re: Undomanager for custom object?

2012-03-13 Thread Kyle Sluder
On Mar 13, 2012, at 1:49 PM, Luc Van Bogaert wrote: > Hi, > > In my document-based app, I am using NSDocument's NSUndoManager to implement > undo/redo. As part of my document objects, I have to deal with a custom > object, for which I would also like to implement undo/redo. I know > NSRespond

[Q] Why is the threading and UI updating designed to be done only on a main thread?

2012-03-13 Thread JongAm Park
Hello, While doing projects with Cocoa and Objective-C, I have always thought that allowing UI update only on main thread was a weak point of Cocoa/Objective-C. Especially, when gracefully terminating threads which would be better update some UI stuff and if main thread is required to wait unt

Re: Undomanager for custom object?

2012-03-13 Thread Seth Willits
On Mar 13, 2012, at 1:49 PM, Luc Van Bogaert wrote: > In my document-based app, I am using NSDocument's NSUndoManager to implement > undo/redo. As part of my document objects, I have to deal with a custom > object, for which I would also like to implement undo/redo. I know > NSResponder has und

Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?

2012-03-13 Thread Jens Alfke
On Mar 13, 2012, at 2:09 PM, JongAm Park wrote: > Is there any reason to design threading and UI update model like this? Yes. Parallel computing with shared state is extremely hard. So hard that I don’t think it’s even well-understood yet, in particular how one can properly test such a system.

Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?

2012-03-13 Thread Stephen J. Butler
On Tue, Mar 13, 2012 at 4:09 PM, JongAm Park wrote: > In other words, the thread function may want to update UI like inserting a > log message to a text field on a window and thus asking main thread to do > so, and main thread is waiting to acquire a lock or waiting using "Join", > then either the

Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?

2012-03-13 Thread Brian Lambert
The short answer is that: 1) Given our current languages and tools, parallel programming is hard. 2) For the moment, it is generally the case that one thread is enough to keep a UI updated and responding to events, thus avoiding #1. 3) When one thread isn't enough to keep a UI updated and respondi

NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?

2012-03-13 Thread Eric Wing
I have a very simple custom view where I override keyDown: and keyUp:. I just put an NSTextField on top of my custom view in Interface Builder (subview of my custom view). When I type in the text field (it has focus), I noticed that my custom view is picking up all the keyEvents. I wasn't expectin

Re: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?

2012-03-13 Thread jonat...@mugginsoft.com
On 13 Mar 2012, at 22:50, Eric Wing wrote: > I have a very simple custom view where I override keyDown: and keyUp:. > > > Is there a way to get the text field (and any other widgets that might > do this like NSTextView) to consume the events they process so my > custom view doesn't receive them

NSDrawTiledRects Only Draws One Side

2012-03-13 Thread Chris Tracewell
Using XCode 3.2.6, OSX 10.6.8 - GC is on I have three rects I am trying to stroke on all four sides using NSDrawTiledRects however only the first side listed in my NSRectEdge list gets drawn. I'm using the boundsRect as the clippingRect but that shouldn't should it? I did experiment with inset

Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?

2012-03-13 Thread Jay Reynolds Freeman
Notwithstanding the good advice about parallel programming given earlier in this thread, there are still possible problems. By way of illustration, a year or two ago I submitted a bug report (#8338166) about a problem of this sort in iOS. I will describe the problem here. (I am not looking fo

Re: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?

2012-03-13 Thread Eric Wing
On 3/13/12, jonat...@mugginsoft.com wrote: > > On 13 Mar 2012, at 22:50, Eric Wing wrote: > >> I have a very simple custom view where I override keyDown: and keyUp:. >> >> >> Is there a way to get the text field (and any other widgets that might >> do this like NSTextView) to consume the events th

Re: NSDrawTiledRects Only Draws One Side

2012-03-13 Thread Jens Alfke
On Mar 13, 2012, at 4:33 PM, Chris Tracewell wrote: > NSDrawTiledRects(NSInsetRect(theVendorTextRect,10,10), theVendorTextRect, > theSides, theGrays, 1); > NSDrawTiledRects(theBillToTextRect, theBillToTextRect, theSides, theGrays, 1); > NSDrawTiledRects(theShipToTextRect, theShipToTextRect, theS

Re: String Constants the solution

2012-03-13 Thread William Squires
I just do a #define in the header like #define kDictionayKey1 @"key1" #define kDictionaryKey2 @"key2" then use it somewhere in the .m file foo = [myDic objectForKey:kDictionaryKey1]; and so on... On Mar 8, 2012, at 6:29 PM, Prime Coderama wrote: > I have references to 'ground' and 'air' in mu

Memory, Swap used by whom?

2012-03-13 Thread Gerriet M. Denkmann
Is there a Cocoa method which gives me to any (physical) memory address the status - like "used by process a" or: "shared by processes a, b, ..., z" or "free"? And also I would like to know, which processes have things swapped out. If there is no Cocoa way, any C-Api would be welcome as well.