Re: Debugging bindings with -NSBindingDebugLogLevel 1

2012-07-07 Thread Rick Mann
I finally did see a rather unhelpful debug message from bindings. Not sure which setting actually triggered it, but I guess it's working. On Jul 7, 2012, at 21:41 , Rick Mann wrote: > I tried adding '-NSBindingDebugLogLevel 1' (no quotes) to "Arguments Passed > on Launch" to my scheme, and I al

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Lee Ann Rucker
You've totally hit what I hit when Lion first came out, and it was my big WWDC question that year - took two Apple engineers digging in the code to figure it out; turned out to be a bug lurking since the NeXT days that only gets triggered when you add subviews to the scrollview and use overlay s

Debugging bindings with -NSBindingDebugLogLevel 1

2012-07-07 Thread Rick Mann
I tried adding '-NSBindingDebugLogLevel 1' (no quotes) to "Arguments Passed on Launch" to my scheme, and I also wrote it to the app's defaults. But I don't see any logging when I've got an error (in this case, a deliberately mis-spelled key path). Am I doing something wrong, or is this not one

Binding from document to app delegate?

2012-07-07 Thread Rick Mann
In Xc4.3.2, the bindings inspector offers auto completion and an indication if you mis-typed a binding. In my simple Document-based app (just created from a template), I'd like a popup menu in my document UI to be populated from a list in the app delegate. I'm successfully doing this by binding

ARC and reinterpret_cast?

2012-07-07 Thread Rick Mann
Hi. I'd like to write code like this: MyObject* foo = reinterpret_cast<__bridge MyObject*> (someVoidPointer); But the compiler doesn't like it. It's perfectly happy with: MyObject* foo = (__bridge MyObject) someVoidPointer; this is in a .mm file. The error is: error: type name

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Gideon King
>From memory I think the drawing problems only happened when I was trying to >use overlay scrollers. With my own scroller implementation, I wondered what was going on, and I see that the backtrace is totally different when I am using overlay scrollers: frame #0: 0x000100463304 NovaMind5`

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Graham Cox
On 08/07/2012, at 12:13 PM, Gideon King wrote: > Yes, I was using that type of code before too, but it didn't work with the > new scrollbar styles (drawing artifacts on resize, not automatically hiding), > which is what prompted me to look at subclassing the scroller itself instead. > Unfortun

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Gideon King
Yes, I was using that type of code before too, but it didn't work with the new scrollbar styles (drawing artifacts on resize, not automatically hiding), which is what prompted me to look at subclassing the scroller itself instead. Unfortunately it still only works with the legacy style scrollers

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Gideon King
Yes, you are correct - I was just drawing the frame of the accessory view as a sanity check, and it worked as expected. It turns out that the problem is with the 10.7+ overlay scroller drawing. If I return NO from +isCompatibleWithOverlayScrollers then it all works as expected. If I return YES,

Re: Document Based Application

2012-07-07 Thread Graham Cox
On 08/07/2012, at 8:41 AM, koko wrote: > My Document Based Application is to have n document types. > > Is it then proper to create n subclasses of NSDocument and the corresponding > plist Document types entries, i.e. Item 0 thru Item n-1 ? You can do it that way, or you can let a NSDocument

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Graham Cox
On 07/07/2012, at 6:38 PM, Gideon King wrote: > Has anybody successfully added a subview to an NSScroller? Yes, but more recently I took it out again and moved that extra view elsewhere, because on Lion/Mountain Lion, these scroll areas are handled differently and the presence of an extra vie

Re: slow first context menu

2012-07-07 Thread Jens Alfke
On Jul 7, 2012, at 5:40 PM, James Maxwell wrote: > I'm finding that the first time I ask for a context menu (i.e., control-click > or two-finger tap) it takes several seconds to come up. After that it > responds normally. Has anybody seen this and, if so, do you recall what the > problem was?

slow first context menu

2012-07-07 Thread James Maxwell
Hello All, I'm finding that the first time I ask for a context menu (i.e., control-click or two-finger tap) it takes several seconds to come up. After that it responds normally. Has anybody seen this and, if so, do you recall what the problem was? (It only happens on my laptop, not my desktop..

Re: NSFileManager directory lists and hidden files

2012-07-07 Thread Michael Hall
On Jul 7, 2012, at 6:48 PM, Ken Thomases wrote: > On Jul 7, 2012, at 5:58 PM, Michael Hall wrote: > >> How do I get the enumeratorAtURL to include the .DS_Store files. > > It does for me on 10.6.8. How are you testing for a file you've seen before? > Maybe you did actually get it in the enum

Re: NSFileManager directory lists and hidden files

2012-07-07 Thread Ken Thomases
On Jul 7, 2012, at 5:58 PM, Michael Hall wrote: > How do I get the enumeratorAtURL to include the .DS_Store files. It does for me on 10.6.8. How are you testing for a file you've seen before? Maybe you did actually get it in the enumeration but your logic for determining if a file is new is w

How to set a default filter on an NSTableView so that no data is displayed if NSSearchField is empty?

2012-07-07 Thread Peter
Hi, is there an elegant/easy way to achieve this? The scenario: Target 10.5 on OS 10.6 (10.5 may be given up in the future). Cell based table view bound to core data. Controller set to prepares content, so all the data is loaded. On entering a string into an NSSearchField the data is filtered. T

NSFileManager directory lists and hidden files

2012-07-07 Thread Michael Hall
I am trying to write something using kqueue to monitor a directory. It is my understanding that for file creation I will be told a directory has been written to and I then have to list the directory myself to determine the file added. I add the original directory path files using enumeratorAtU

Document Based Application

2012-07-07 Thread koko
My Document Based Application is to have n document types. Is it then proper to create n subclasses of NSDocument and the corresponding plist Document types entries, i.e. Item 0 thru Item n-1 ? Is it true that all n document types will have a common extension but will be identified by the Docu

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Andy Lee
I took that to mean he was drawing the frame of the accessory view with something like NSFrameRect(), not sending a draw message to the accessory view. Come to think of it, this answers one of my questions. Assuming the test code is something like... // Sanity-check the frame of the accesso

changing string in a view based NSTableView

2012-07-07 Thread Koen van der Drift
I'd like to change the change the string that is displayed in my view based NSTableView to a lowercase string. So I implemented the following in the delegate of the tableview: - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Kyle Sluder
On Jul 7, 2012, at 1:38 AM, Gideon King wrote: > > I overrode the drawSelf: method and got it to draw the frame of the accessory > view, to make sure it was positioned correctly, and it drew in the right > place. Wait, you told another view to draw from within a separate view's -drawRect:? T

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Andy Lee
On Jul 7, 2012, at 4:38 AM, Gideon King wrote: > Any ideas what I might be missing? Has anybody successfully added a subview > to an NSScroller? FWIW I did a quick test where all I did was add a subview to one of the NSScrollers in an NSScrollView, and it drew just fine. Have you double-checked

[Solved] Custom NSViews

2012-07-07 Thread William Squires
Thanks to Graham Cox, I can now finish this part of my 'simple' project… which grew and grew! :) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at coc

Re: Custom NSViews

2012-07-07 Thread William Squires
MacOS X (10.6 base SDK) On Jul 6, 2012, at 7:13 PM, Alex Zavatone wrote: > iOS or Mac OS? > > On Jul 6, 2012, at 7:55 PM, William Squires wrote: > >> Okay, I've got my custom NSView subclass to draw my Shape objects (or >> subclasses thereof). Each Shape inherits or overrides: >> >> -(BOOL)sh

Problem adding subview to NSScroller subclass

2012-07-07 Thread Gideon King
Hi all, I am creating a subclass of NSScroller so that I can add an accessory view. I have worked out the position to add it, and added it as a subview, but it is never drawn. I have overridden the rectForPart: method to adjust the scroller size, and that leaves the gap as it should. I overrod