Re: Getting NSApplicationDelegate protocol

2012-07-07 Thread ecir hana
On Sat, Jul 7, 2012 at 6:30 AM, Ken Thomases k...@codeweavers.com wrote: Thank you. And please, can you explain to me why is it that case? Is it simply because AppKit includes the definition of NSTextViewDelegate protocol and not includes one for NSApplicationDelegate? Correct. Is it

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

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:

[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

Re: Problem adding subview to NSScroller subclass

2012-07-07 Thread Kyle Sluder
On Jul 7, 2012, at 1:38 AM, Gideon King gid...@novamind.com 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

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 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

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

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

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.

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

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

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

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? (It

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

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 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

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

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.

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

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

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

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

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 also