How do I bind custom view properties to an NSCollectionViewItem?

2010-01-03 Thread Rick Mann
In the example for NSCollectionView, they show binding text labels to the collection view item's represented object's properties. This is fine and makes sense. But my item view contains a custom view that needs access to the represented object in the NSCollectionViewItem. Since my custom view

Re: NSBezierPath linewidth not correct

2010-01-03 Thread Heinrich Giesen
On 03.01.2010, at 00:45, Rob Keniger wrote: It will probably be easier to create an NSAffineTransform and translate the whole context by 0.5px, so all drawing is offset without you needing to fiddle with individual values. Just a hint: NSBezierPath has a method which allows to use

Re: Custom NSFormatter classes

2010-01-03 Thread Patrick Mau
Hallo Henri Your assumption about how formatters should work are correct. To provide a useful answer I have setup a mini project here, because I have stumbled over a detail I did not now: http://public.me.com/pmau I took your approach and implemted a minimal datasource and a Foo object. This

Re: How do I bind custom view properties to an NSCollectionViewItem?

2010-01-03 Thread Markus Spoettl
On Jan 3, 2010, at 9:11 AM, Rick Mann wrote: In the example for NSCollectionView, they show binding text labels to the collection view item's represented object's properties. This is fine and makes sense. But my item view contains a custom view that needs access to the represented

Re: Drawing on top of QTCaptureView

2010-01-03 Thread Bengt Nilsson
Hi again, 1 jan 2010 kl. 13.13 skrev Mike Abdullah: QTCaptureView is almost certainly internally using something along the lines of OpenGL internally to draw onscreen with acceptable performance. This means you can't draw on top of it with standard Cocoa drawing techniques. The options:

Re: NS_INLINE and obj = nil;?

2010-01-03 Thread Greg Parker
On Jan 2, 2010, at 9:30 AM, Alexander Spohr wrote: I put a , not a ; between the statements. So at least my last example would work - had I just left the last ; out of it: #define GDRelease(x) [(x) release], (x) = nil expands to: if(x) [(x) release], (x) = nil; else foo(x); But

Re: Drawing on top of QTCaptureView

2010-01-03 Thread Bengt Nilsson
Hi again, After reading about layer-backed views in http://www.macresearch.org/tutorial-intro-core-animation, I enabled it in IB and this was the solution. The cross-hair by two NSBox-es added in IB stayed on while the USB camera review was running. Thanks for all the support. 1 jan 2010 kl.

Re: NSBezierPath linewidth not correct

2010-01-03 Thread Gustavo Pizano
AHA Interesting.. I was thinking something like that.. but in lower level using Quartz directly adn the CGContextRef and the transformations. I will give it a try ... Thanks :D Gustavo On Jan 3, 2010, at 12:29 PM, Heinrich Giesen wrote: On 03.01.2010, at 00:45, Rob Keniger wrote:

Re: Drawing on top of QTCaptureView

2010-01-03 Thread PCWiz
This probably isn't relevant, but NSBoxes aren't the best way to create crosshairs. It would be cleaner to just make a (very) simple NSView subclass that draws the 2 lines. Independent Cocoa Developer, Macatomy Software http://macatomy.com On 2010-01-03, at 9:30 AM, Bengt Nilsson wrote: Hi

Re: Custom NSFormatter classes

2010-01-03 Thread Henri Häkkinen
Hello Patric. I was able to get the NSFormatter subclass to work properly by ignoring all non-Foo objects sent to it. The Cocoa docs are indeed lacking in this respect as there is no mentioning that the cell's title will first be sent. To me this feels a bit odd anyway since I can think of no

Question about garbage collection

2010-01-03 Thread Michael Abendroth
Hi all, When I write something like: while (true) { NSString *s = [[NSString alloc] initWithString:@applejuice]; } Will s be garbage collected? If not, how can I make sure it does get deallocated by garbage collection. ___ Cocoa-dev mailing list

Re: Question about garbage collection

2010-01-03 Thread Bill Bumgarner
On Jan 3, 2010, at 9:59 AM, Michael Abendroth wrote: When I write something like: while (true) { NSString *s = [[NSString alloc] initWithString:@applejuice]; } Will s be garbage collected? If not, how can I make sure it does get deallocated by garbage collection. I'm not entirely

Setting NSWindow titlebar height

2010-01-03 Thread PCWiz
I have a window that looks like this right now: http://img22.imageshack.us/img22/2953/screenshot20100103at123.png I've removed the titlebar buttons and everything, however there is still that space at the top where the titlebar usually is. Is there a way to remove that space (in other words, a

Re: Landscape view drawing as if in portrait mode

2010-01-03 Thread Matt Neuburg
On Thu, 31 Dec 2009 23:49:54 -0800 (PST), Ian was here howlew...@yahoo.com said: It works fine when I initially attach a view to the view controller, but when releasing it and attaching a new view, it screws up. There may be some larger misconception at work here. You should not be releasing a

Re: How do I bind custom view properties to an NSCollectionViewItem?

2010-01-03 Thread Rick Mann
On Jan 3, 2010, at 06:32:33, Markus Spoettl wrote: On Jan 3, 2010, at 9:11 AM, Rick Mann wrote: In the example for NSCollectionView, they show binding text labels to the collection view item's represented object's properties. This is fine and makes sense. But my item view contains a

Re: Setting NSWindow titlebar height

2010-01-03 Thread Alexander Heinz
You could try calling NSWindow's setBorderThickness:forEdge: on NSMaxYEdge. Don't know if it will work, but that would be where I would start. HTH, Alex On Jan 3, 2010, at 11:41 AM, PCWiz wrote: I have a window that looks like this right now:

Re: Setting NSWindow titlebar height

2010-01-03 Thread PCWiz
I already tried that, but also in the docs it mentions that setContentBorderThickness for NSMaxYEdge only works on textured windows (which mine isn't) Independent Cocoa Developer, Macatomy Software http://macatomy.com On 2010-01-03, at 1:50 PM, Alexander Heinz wrote: You could try calling

Re: NS_INLINE and obj = nil;?

2010-01-03 Thread Dave G
2010/1/4 Greg Parker gpar...@apple.com: On Jan 2, 2010, at 9:30 AM, Alexander Spohr wrote: I put a , not a ; between the statements. So at least my last example would work - had I just left the last ; out of it: #define GDRelease(x) [(x) release], (x) = nil expands to: if(x)   [(x)

Re: NS_INLINE and obj = nil;?

2010-01-03 Thread Scott Ribe
Easily fixed: #define GDRelease(x) [(x) release], (x) = nil, (void)0 Not really a good fix; compiler error is preferable to tweaking your macro to allow compilation of nonsense ;-) -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice

Re: Why is [NSArray arrayWithObjects:] failing for me?

2010-01-03 Thread Seth Willits
On Jan 2, 2010, at 11:44 AM, Charles Jenkins wrote: NSArray* pnl = [NSArray arrayWithObjects:pa,pb,pc,pd,nil]; [parentDocument setPlayerNameList:pnl]; [pnl release]; KABOOM. You are over-releasing pnl. The release call is unnecessary because the array was not alloc/init'd, made by copy,

Re: Why is [NSArray arrayWithObjects:] failing for me?

2010-01-03 Thread Seth Willits
On Jan 3, 2010, at 2:30 PM, Seth Willits wrote: NSArray* pnl = [NSArray arrayWithObjects:pa,pb,pc,pd,nil]; [parentDocument setPlayerNameList:pnl]; [pnl release]; KABOOM. You are over-releasing pnl. The release call is unnecessary because the array was not alloc/init'd, made by copy, or

Re: Question about garbage collection

2010-01-03 Thread Graham Cox
On 04/01/2010, at 4:59 AM, Michael Abendroth wrote: When I write something like: while (true) { NSString *s = [[NSString alloc] initWithString:@applejuice]; } Will s be garbage collected? If not, how can I make sure it does get deallocated by garbage collection. As written, it's

exposeBinding:

2010-01-03 Thread Rick Mann
Is -exposeBinding: only necessary when implementing an IB plug-in? Or is it required to make bind: work at all (on a custom object)? I find two slightly conflicting statements in the docs about this. TIA, Rick ___ Cocoa-dev mailing list

Carbon Services under Cocoa app?

2010-01-03 Thread Kevin Walzer
I'm trying to transition some well-debugged Carbon code that implements services to a Cocoa-based version of my application. Because the code works fine under 32-bit Carbon, I'd rather not rework that code in Cocoa unless necessary. What I'm finding is that the Carbon-based code is no-op

Revolving scoreboard

2010-01-03 Thread gumboots
I have been asked to design a revolving scoreboard for a large Sporting Clays event. The plan is to have a MacBook connected to a large flat screen TV in the main tent. I will pull the scores from a CSV file (which is updated regularly) and sort them into arrays for display. Creating the on

Re: exposeBinding:

2010-01-03 Thread Quincey Morris
On Jan 3, 2010, at 14:56, Rick Mann wrote: Is -exposeBinding: only necessary when implementing an IB plug-in? Or is it required to make bind: work at all (on a custom object)? I find two slightly conflicting statements in the docs about this. I can't speak definitively, but I believe the

Re: Revolving scoreboard

2010-01-03 Thread Mike Abdullah
Core Animation is the perfect tech for this. Probably by using layer-backed table views to display the scores. On 3 Jan 2010, at 23:07, gumbo...@mac.com wrote: I have been asked to design a revolving scoreboard for a large Sporting Clays event. The plan is to have a MacBook connected to a

Re: Revolving scoreboard

2010-01-03 Thread PCWiz
This isn't something thats extremely difficult to do. You will need to create NSView subclasses for the scores at the top. You can use NSAttributedString/NSMutableAttributedString to create styled text, and use their drawInRect method to draw the text into the view. It would be a good idea to

Re: Revolving scoreboard

2010-01-03 Thread Andrew Farmer
On 3 Jan 2010, at 15:24, Mike Abdullah wrote: Core Animation is the perfect tech for this. Probably by using layer-backed table views to display the scores. Quartz Composer is also worth looking into if you're after a full-screen display with a minimum of coding. The default RSS and Word Of

Re: Revolving scoreboard

2010-01-03 Thread Scott Anguish
I don’t think using NSScrollView is at all necessary in this case. That’s much more of a situation for user interaction. This sounds more like the case for creating a view subclass that contains a view that displays the current score. When the score increases, insert another view visually

Re: Revolving scoreboard

2010-01-03 Thread PCWiz
Good point, the view subclass would be easy and clean. Independent Cocoa Developer, Macatomy Software http://macatomy.com On 2010-01-03, at 6:10 PM, Scott Anguish wrote: I don’t think using NSScrollView is at all necessary in this case. That’s much more of a situation for user interaction.

Re: Question about garbage collection

2010-01-03 Thread Bill Bumgarner
On Jan 3, 2010, at 2:45 PM, Graham Cox wrote: On 04/01/2010, at 4:59 AM, Michael Abendroth wrote: When I write something like: while (true) { NSString *s = [[NSString alloc] initWithString:@applejuice]; } Will s be garbage collected? If not, how can I make sure it does get

Re: Question about garbage collection

2010-01-03 Thread Ben Haller
On 3-Jan-10, at 8:31 PM, Bill Bumgarner wrote: On Jan 3, 2010, at 2:45 PM, Graham Cox wrote: On 04/01/2010, at 4:59 AM, Michael Abendroth wrote: When I write something like: while (true) { NSString *s = [[NSString alloc] initWithString:@applejuice]; } Will s be garbage collected? If not,

Problem chaining initialization methods

2010-01-03 Thread Mike Chambers
I am having a weird problem when chaining initializers in a class which extends NSPredicateEditorRowTemplate. If I call the -(id)initWithArray:(NSArray *)arr forKeyPath:(NSString *)keyPath andTitle:(NSString *)title initializer directly when initializing, then everything works. However, if I

Re: Problem chaining initialization methods

2010-01-03 Thread Dave DeLong
A simple glance over looks like you're missing the assignation to self. Shouldn't it be if (!(self = [self initWithArray:arr forKeyPath:keyPath andTitle:capPath])) { ... ? Dave On Jan 3, 2010, at 7:36 PM, Mike Chambers wrote: So, does anyone see anything obviously wrong with how I am

Re: Problem chaining initialization methods

2010-01-03 Thread Rick Genter
On Jan 3, 2010, at 6:36 PM, Mike Chambers wrote: -(id)initWithArray:(NSArray *)arr forKeyPath:(NSString *)keyPath { NSString *capPath = [keyPath capitalizedString]; if(![self initWithArray:arr forKeyPath:keyPath andTitle: capPath]); { return nil; }

NSScrollView scroller size

2010-01-03 Thread Rainer Standke
Hello, is there any way set the scroller size to something less than regular in a scroll view? Since I am on Interface Builder 3.1.2, that seems to not work any more. Is there anything I'm missing? Thanks, Rainer ___ Cocoa-dev mailing list

Re: NSScrollView scroller size

2010-01-03 Thread Seth Willits
On Jan 3, 2010, at 7:46 PM, Rainer Standke wrote: is there any way set the scroller size to something less than regular in a scroll view? Since I am on Interface Builder 3.1.2, that seems to not work any more. Is there anything I'm missing? Select the scroller like you would any other

Need font anti aliasing techniques

2010-01-03 Thread padmakumar
What are all the ways we can programmatically make anti aliasing techniques for texts displayed in NSTextField. regards PK ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Return in NSSearchField

2010-01-03 Thread Gerriet M. Denkmann
The docs say: By default, the cell’s action is invoked during typing after a short delay. And it also sends the action message when the user presses the Return key. Both are things I like as they are. But: I would also like to know, whether the action was send because the user did press

iPhone: load cell from XIB slows down tableview?

2010-01-03 Thread John Michael Zorko
Hello, all ... I'm trying to determine why my tableviews scroll so jerkily on non-3GS devices. The datasource only has perhaps 170 records, so I think it may have something to do with how i'm instantiating the cells in -tableView:cellForRowAtIndexPath. In other apps i've done, I create the

Re: Setting NSWindow titlebar height

2010-01-03 Thread Joar Wingfors
On 3 jan 2010, at 11.41, PCWiz wrote: I've removed the titlebar buttons and everything, however there is still that space at the top where the titlebar usually is. Is there a way to remove that space (in other words, a way to set the height of the title bar?). The only way I know would be

NSSearchField and bindings question

2010-01-03 Thread lorenzo7620
I'm going the Zarra book, Core Data and I;ve reached the section where an NSSearchfield is bound to one of the arrays used in the sample application (page 43). As instructed in the book, I configured the NSSearchfield's predicate binding as follows: Controller Key: filterPredicate Model Key

Re: Revolving scoreboard

2010-01-03 Thread gumboots
Thanks Guys, that will work really well and its a nice neat solution. Can you elaborate on the animation proxy a little bit or rather point me in the right direction. Cheers Rob On 4/01/2010, at 2:29 PM, PCWiz wrote: Good point, the view subclass would be easy and clean. Independent Cocoa