Re: Subview bounds resizing when frame resizes

2008-03-02 Thread Jens Alfke
On 2 Mar '08, at 4:03 PM, Steve Weller wrote: The subview bounds are set correctly at the start, but if I make the subview's frame larger, the bounds are scaled larger too. I thought from this in the NSView docs that the subview's bounds would stay fixed: Nope. Changing a view's frame do

Re: Spotlight importer for records

2008-03-02 Thread Jens Alfke
On 2 Mar '08, at 10:09 PM, Adam P Jenkins wrote: I'd like to make Spotlight index individual records from my application, rather than whole files. Spotlight doesn't support that yet. Its unit of granularity is whole files. Some examples of this are Apple's own iCal, Address Book, and M

Re: NSString and string contains

2008-03-02 Thread Jens Alfke
On 2 Mar '08, at 1:44 PM, Andrew Merenbach wrote: You probably want to use enumerators and something like the following code: That's debatable. Personally, I hate using NSEnumerator because it's slow. (Not only does it create an autoreleased enumerator object, but most of the standard co

Re: NSString and string contains

2008-03-02 Thread Chris Hanson
On Mar 2, 2008, at 12:31 PM, Tom Jones wrote: I have an NSArray which contains String values and I want to loop though it and determine if any of those string contain words I'm looking for. I have tried but have been unsuccessful. Predicates are great for this. They're a Foundation facilit

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread Jens Alfke
On 2 Mar '08, at 4:54 AM, Steven Degutis wrote: I think it's clear why [currentTrack isKindOfClass:[iTunesFileTrack class]] evaluates to true: in the previous line, you defined it as such, like this: iTunesTrack *currentTrack = [iTunes currentTrack]; So obviously it is an iTunesTrack! No. It

Spotlight importer for records

2008-03-02 Thread Adam P Jenkins
I'd like to make Spotlight index individual records from my application, rather than whole files. Some examples of this are Apple's own iCal, Address Book, and Mail.app. For instance if you type in someone's name in the Spotlight search box, in addition to files which contain that name, i

Re: When in the launch cycle does coredata data become available.

2008-03-02 Thread Adam Gerson
Hi mmalc, Thanks, this does directly address my question. Not exactly sure what to do with it. I tried calling fetchWithRequest:merge:error: in awakeFromNib and then trying to access the managed object, but that didn't work. Adam On Sun, Mar 2, 2008 at 9:59 PM, mmalc crawford <[EMAIL PROTECTED]

NSDocument and control of multiple views

2008-03-02 Thread Steve Weller
I have a document-based application that has a custom view that fills much of the content view. In that custom view I want to display a "page" like a piece of paper. As the window is scaled, the "page" scales. This all works either if I code the page as a part of the custom view, or if I

Re: Subview bounds resizing when frame resizes

2008-03-02 Thread Steve Weller
On Mar 2, 2008, at 4:03 PM, Steve Weller wrote: I have a custom view with a custom subview. I can't seem t make the bounds of the subview stick. When the view changes the subview's frame, I want the subview's bounds to stay exactly as I set them the first time. The whole point of having

Re: Core Data and retain count

2008-03-02 Thread Bill
On Mar 2, 2008, at 5:35 PM, Ben Trumbull wrote: My question is, why would changing a property value cause another property to have its retain count increase? No idea. Why don't you run it in gdb and break on the -retain method and get some stack traces ? This works best if the class you're d

Re: Issue about cocoa Multi-document template

2008-03-02 Thread Doug Knowles
Good point. In my case, I'm deviating from convention for two purposes: - I expect the most common use of my application is to have one or very few documents in existence, and that the user will usually prefer the application to automatically open whatever document(s) were open when it last closed

Re: When in the launch cycle does coredata data become available.

2008-03-02 Thread mmalc crawford
On Mar 2, 2008, at 6:36 PM, Adam Gerson wrote: NSArray *allServers = [serverLibraryArrayController arrangedObjects]; This code works just fine with I invoke it with a button click. However, if I put it in awakeFromNib or ApplicationDidFInishLaunching it returns nil.

When in the launch cycle does coredata data become available.

2008-03-02 Thread Adam Gerson
I am trying to programatically get some data from an array controller when my program launches. NSArray *allServers = [serverLibraryArrayController arrangedObjects]; This code works just fine with I invoke it with a button click. However, if I put it in awakeFromNib or ApplicationDidFInishLaunchi

Re: Handling mouse click event on a NSButton

2008-03-02 Thread I . Savant
I'm using Cocoa from Pascal using PasCocoa ( http://wiki.lazarus.freepascal.org/PasCocoa ), so I can't use objective-c language constructions and need to get this working with just objective-c runtime headers. I tryed to see the assembly for @selector(something:); but it isn't promissing. It calls

Re: Handling mouse click event on a NSButton

2008-03-02 Thread I. Savant
But setAction expectes just a selector as parameter, so it seams to me that a lot of information about the method to be called is missing. AFAIK a selector just identifies the name of the method, but the class to which it bellongs to is missing and also the pointer to it's instance and the pointer

Re: Handling mouse click event on a NSButton

2008-03-02 Thread Felipe Monteiro de Carvalho
Hi, thanks, now I read those docs, but there is still something I don't understand. There they recommend I should use something like: [aControl setAction:@selector(deleteRecord:)]; But setAction expectes just a selector as parameter, so it seams to me that a lot of information about the method to

Re: Bypassing inter-cell navigation for NSButtonCell in NSOutlineView

2008-03-02 Thread Nicholas Riley
On Sun, Mar 02, 2008 at 04:24:04PM +0100, Tommy Nordgren wrote: > >>- Back tabbing into a table will select the last focusable cell. > > > >and I can't figure out how to stop that from happening. > > > >Help? > > > You probably need to modify your keyDown: method to intercept > backtabs as

re: Core Data and retain count

2008-03-02 Thread Ben Trumbull
My question is, why would changing a property value cause another property to have its retain count increase? No idea. Why don't you run it in gdb and break on the -retain method and get some stack traces ? This works best if the class you're debugging (in this case the value window control

Re: Reading word at mouse pointer w/o Universal Access

2008-03-02 Thread Nir Soffer
On Feb 29, 2008, at 03:27, Ryan Homer wrote: I've read this post (http://lists.apple.com/archives/accessibility- dev/2006/Aug/msg7.html) about using the accessibility options to read the text under the cursor. However, this requires that the user enable access for assistive devices in S

Re: NSString and string contains

2008-03-02 Thread Johannes Huning
Or if your're on Leopard using the new enumerator: NSString *searchFor = @"home"; NSRange range; for (NSString *string in stringList) { range = [word rangeOfString:searchFor]; if (range.location != NSNotFound) { NSLog (@"Yay! '%@' found in '%@'.", searchFor, string); } } Correc

Re: Subclassing NSOutlineView causes failure of window to become main or key

2008-03-02 Thread Dennis Hartigan-O'Connor
Thanks, John, In all these cases, I can use NSLog to print to the Run Log--but no errors are printed there by the system. In all cases, the Console Log is blank. In cases where the window doesn't become main or key, if I attach the debugger I find that the thread list looks exactly the SAME

Re: Core Data opens files as empty

2008-03-02 Thread mmalc crawford
On Mar 2, 2008, at 4:39 PM, mmalc crawford wrote: I can see that the document actually contains the data I saved. Sorry, didn't read that last line... Most likely you missed a step. Compare with a similar example in

Re: Core Data opens files as empty

2008-03-02 Thread Andrew Merenbach
Hi, Jamie, Have you set your array controller or tree controller to "prepare content automatically"? Cheers, Andrew On Mar 2, 2008, at 3:19 PM, Jamie Phelps wrote: I'm sorry if this has been covered, but I searched the archives (http://moourl.com/x50hf ) and didn't find any answers

Re: Bypassing inter-cell navigation for NSButtonCell in NSOutlineView

2008-03-02 Thread Rosyna
Have you tried overriding - (BOOL)canFocusCell:(NSCell *)cell atTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; to return NO in an outline view subclass? On Mar 2, 2008, at 6:42 AM, Nicholas Riley wrote: In Leopard, checkboxes in my NSOutlineViews get keyboard focus when I p

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread has
Adam P Jenkins wrote: I'm not sure what the logic is behind the "get" method, but there it is. It's completely logical if you appreciate that Apple event IPC is RPC +queries. To tell a scriptable application to perform an operation, you send it a command (Apple event). If the command oper

Re: Handling mouse click event on a NSButton

2008-03-02 Thread I. Savant
I have a NSButton and I would like to have some code executed when the button is clicked. Special circunstances for this is that my button is created purely in code, there are no nib files on the project and also no use of the Interface Builder, and nor can it be, because I'm developing a cross-pl

Re: Core Data opens files as empty

2008-03-02 Thread mmalc crawford
On Mar 2, 2008, at 3:19 PM, Jamie Phelps wrote: I'm sorry if this has been covered, but I searched the archives (http://moourl.com/x50hf ) and didn't find any answers. I just went through the Core Data tutorial here:http://developer.apple.com/cocoa/coredatatutorial/index.html Everything wen

Replace NSPopupButton Menu/Binding

2008-03-02 Thread Keith Duncan
I have an NSPopupButton whose menu I need to change based on a model property. I'm observing selection.property of the relevant NSArrayController to be notified when the menu needs to change. I need to alternate between a provided menu and a content array provided by another array controlle

Handling mouse click event on a NSButton

2008-03-02 Thread Felipe Monteiro de Carvalho
Hello, I have a NSButton and I would like to have some code executed when the button is clicked. Special circunstances for this is that my button is created purely in code, there are no nib files on the project and also no use of the Interface Builder, and nor can it be, because I'm developing a c

Subview bounds resizing when frame resizes

2008-03-02 Thread Steve Weller
I have a custom view with a custom subview. I can't seem t make the bounds of the subview stick. When the view changes the subview's frame, I want the subview's bounds to stay exactly as I set them the first time. The whole point of having this subview is to have a separate coordinate sys

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread Adam P Jenkins
On Mar 2, 2008, at 6:16 PM, Adam P Jenkins wrote: Just call the "get" method on the track object that currentTrack returns to get the iTunesFileTrack object. I.e. this works iTunesFileTrack *currentTrack = [[iTunes currentTrack] get]; NSLog("location is %@", currentTrack.location); The docu

Render an animation in a bitmap file (CARenderer)

2008-03-02 Thread Martin
Hi, I'd like to render a CALayer animation in a series of bitmap files rather that in an NSView. I've succeeded in rendering 1 frame in a bitmap file by : - creating a NSOpenGLContext - creating a CARenderer (named renderer) - calling the following code: [renderer beginFrameAtTime:0.0 timeS

Core Data opens files as empty

2008-03-02 Thread Jamie Phelps
I'm sorry if this has been covered, but I searched the archives (http://moourl.com/x50hf ) and didn't find any answers. I just went through the Core Data tutorial here: http://developer.apple.com/cocoa/coredatatutorial/index.html Everything went well except that when I save a document and then

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread Adam P Jenkins
Just call the "get" method on the track object that currentTrack returns to get the iTunesFileTrack object. I.e. this works iTunesFileTrack *currentTrack = [[iTunes currentTrack] get]; NSLog("location is %@", currentTrack.location); The documentation for the "get" method from the SBObject.h h

Re: Subclassing NSOutlineView causes failure of window to become main or key

2008-03-02 Thread John Stiles
Is anything printed to the Run Log or Console? Dennis Hartigan-O'Connor wrote: I'm trying to use a subclass of NSOutlineView to allow merged columns, so that some cells can run over their bounds, using methods I read about at: http://www.mactech.com/articles/mactech/Vol.18/18.11/1811TableTech

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread has
Jonathan 'Wolf' Rentzsch wrote: On Mar 1, 2008, at 7:28 PM, Hannes Petri wrote: iTunesApplication *iTunes = [[SBApplication alloc] initWithBundleIdentifier:@"com.apple.iTunes"]; iTunesTrack *currentTrack = [iTunes currentTrack]; if ([currentTrack isKindOfClass:[iTunesFileTrack class]]) { … }

Re: Reading word at mouse pointer w/o Universal Access

2008-03-02 Thread Adam Leonard
Just so you know, the Accessibility API has AXMakeProcessTrusted(), which will enable access to the API for just your application. It requires that it be called from a process running as root, so the user needs to enter his/her password, but otherwise it is fully automatic. I blogged about

NSFontManager Initialization

2008-03-02 Thread Gordon Apple
I am using NSFontManager and NSFontPanel to (eventually) extract a glyph as a draw object. The following code fails unless the font panel has previously been used in a text field. NSFontManager* fmgr = [NSFontManager sharedFontManager]; NSFont* theFont = [fmgr selectedFont]; Afte

Re: NSString and string contains

2008-03-02 Thread Andrew Merenbach
Yep, I would've suggested fast enumeration, as I use them myself regularly, except that a beginner might (or might not) find the traditional paradigm easier. Cheers, Andrew On Mar 2, 2008, at 2:01 PM, j o a r wrote: On Mar 2, 2008, at 10:44 PM, Andrew Merenbach wrote: You probabl

Re: NSString and string contains

2008-03-02 Thread j o a r
On Mar 2, 2008, at 10:44 PM, Andrew Merenbach wrote: You probably want to use enumerators and something like the following code: ...and if you're on 10.5 (or later - even if that's kind of unlikely at this point) you'd use the new FAST enumerator: for (NSString *string in array) {

Re: NSString and string contains

2008-03-02 Thread Andrew Merenbach
Hi, Tom, You probably want to use enumerators and something like the following code: NSEnumerator *e = [array objectEnumerator]; NSString *string; while ((string = [e nextObject])) { NSRange range = [string rangeOfString:@"home"]; if (range.location != NSNotFound) {

Re: NSString and string contains

2008-03-02 Thread Seth Willits
On Mar 2, 2008, at 12:31 PM, Tom Jones wrote: id obj; obj = [array objectAtIndex:j]; /* Here is where I'm having trouble I know this is not real :-) if ( [obj inStr:@"home"]) http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NS

NSString and string contains

2008-03-02 Thread Tom Jones
Hello, I'm fairly new to Cocoa, so please excuse me if I'm not using the right terminology. I have an NSArray which contains String values and I want to loop though it and determine if any of those string contain words I'm looking for. I have tried but have been unsuccessful. Example...

Re: Custom View drawn twice?

2008-03-02 Thread Ben Lachman
So I tried this and wasn't able to get it to display the behavior, which makes me assume the issue must be the interaction with the rest of the views in the hierarchy. If I turn off all calls to setNeedsDisplay... I don't get the double drawing, but I also don't get UI updates. The view h

Core Data and retain count

2008-03-02 Thread Kimo
I have a Core Data app that has several entities. One entity, Window, contains several properties such as openAtLaunch, windowName, and wController. The wController attributes are Transformable, Optional and Transient. The data are presented on a list, and when the user double-clicks a r

Subclassing NSOutlineView causes failure of window to become main or key

2008-03-02 Thread Dennis Hartigan-O'Connor
I'm trying to use a subclass of NSOutlineView to allow merged columns, so that some cells can run over their bounds, using methods I read about at: http://www.mactech.com/articles/mactech/Vol.18/18.11/1811TableTechniques/index.html I have four instances of my custom subclass organized in an NST

Re: Bypassing inter-cell navigation for NSButtonCell in NSOutlineView

2008-03-02 Thread Ricky Sharp
On Mar 2, 2008, at 6:29 AM, Nicholas Riley wrote: In Leopard, checkboxes in my NSOutlineViews get keyboard focus when I press Tab. I don't want this to happen. The AppKit release notes state: Tables now support inter-cell navi

Re: [NSOutlineView] How to know an item is expanded if its parent item is not?

2008-03-02 Thread Jonathan Dann
On 1 Mar 2008, at 23:02, Stéphane Sudre wrote: There seems to be a missing method in NSOutlineView. You can know an item is expanded only if its parent is expanded (so that the item itself is visible). This is problematic if you want to cache the current list of expanded items. Instead o

Re: Issue about cocoa Multi-document template

2008-03-02 Thread Gregory Weston
Scott.D.R wrote: Hi everyone. I want to start an application with the cocoa multi-document template. The default behavior of the application is when you launch it, a blank window is automatically open. This behavior is not that I want. I thought the application should not open any window until

Bypassing inter-cell navigation for NSButtonCell in NSOutlineView

2008-03-02 Thread Nicholas Riley
[Resending this as a later email I sent was delivered but this wasn't; sorry if you receive a duplicate copy.] In Leopard, checkboxes in my NSOutlineViews get keyboard focus when I press Tab. I don't want this to happen. The AppKit release notes

Re: Issue about cocoa Multi-document template

2008-03-02 Thread Doug Knowles
You want to create an application delegate, and implement applicationShouldOpenUntitledFile: in the delegate. The application delegate can be an instance of any class. I find it easiest to create an instance of NSObject in Interface Builder, set its class to my delegate class, and bind it the the

Re: Bypassing inter-cell navigation for NSButtonCell in NSOutlineView

2008-03-02 Thread Tommy Nordgren
On 2 mar 2008, at 13.29, Nicholas Riley wrote: ...sbip... 7. overriding keyDown: in the outline view to intercept Tab, which works fine, except... - Back tabbing into a table will select the last focusable cell. and I can't figure out how to stop that from happening. Help? -- Nichola

Re: [NSOutlineView] How to know an item is expanded if its parent item is not?

2008-03-02 Thread Stéphane Sudre
On Mar 2, 2008, at 5:24 AM, Seth Willits wrote: On Mar 1, 2008, at 6:01 PM, John Stiles wrote: Unless Stephane plans on manually tracking the expanded items himself, I don't see how this answers his original question That's what you have to do. I use these notifications to save which it

Bypassing inter-cell navigation for NSButtonCell in NSOutlineView

2008-03-02 Thread Nicholas Riley
In Leopard, checkboxes in my NSOutlineViews get keyboard focus when I press Tab. I don't want this to happen. The AppKit release notes state: Tables now support inter-cell navigation as follows: - Tabbing forward to a table focu

how to forward the event into the document view of the clip view in a NSScrollView?

2008-03-02 Thread Scott . D . R
Hi everyone. As the title mentioned, I found something odd when using the IKimageview with NSScrollView. That is, At first, I directly drop a IKImageView into a window. And in my application, I set the source of the IKImageview. After the application run, I double-click the IKimageView and

Re: Reading word at mouse pointer w/o Universal Access

2008-03-02 Thread Ryan Homer
Steve, While I agree that the user should decide whether or not to allow the application to access another's text, to me, that's exactly what they are doing if they decide to use the application. It is going to be a dictionary-type application, so if the user installs it, s/he would be fu

Re: Reading word at mouse pointer w/o Universal Access

2008-03-02 Thread Ryan Homer
Well, if you are referring to the Services sub-menu that is automatically part of Cocoa applications' menus with the same name as the application (Eg: Mail -> Services, Safari -> Services, etc.), it seems to me that those services are only executed when invoked by the user. However, I want

Re: Charting API?

2008-03-02 Thread Adhamh Findlay
On Mar 1, 2008, at 8:53 PM, David Adalsteinsson wrote: I don't know exactly what the GraphKit API looks like, or which Apple applications actually use it. The graphs don't quite look consistent between KeyNote, Shark, XRay and Activity monitor. KeyNote uses its on classes, Shark, Chud, A

Drawing only when NSOutlineView active?

2008-03-02 Thread Nicholas Riley
I'm attempting to draw a custom NSOutlineView row background only for selected rows of an active outline view; otherwise, the default drawing style is fine. I started with the following: - (void)highlightSelectionInClipRect:(NSRect)clipRect; { // the outline view is in a sheet, so the ma

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread Steven Degutis
Hannes, I haven't heard of this ITApplication before, but for your specific problem, I think it's clear why [currentTrack isKindOfClass:[iTunesFileTrack class]] evaluates to true: in the previous line, you defined it as such, like this: iTunesTrack *currentTrack = [iTunes currentTrack]; So obvio

Re: Problems with ScriptingBridge and iTunes

2008-03-02 Thread has
Hannes Petri wrote: I want to retrieve the path to the currently played file in iTunes. I thought scripting bridge would be the perfect tool for this, however i've run into some problem. I have this code: iTunesApplication *iTunes = [[SBApplication alloc] initWithBundleIdentifier:@"com.apple.iT

Issue about cocoa Multi-document template

2008-03-02 Thread Scott.D.R
Hi everyone. I want to start an application with the cocoa multi-document template. The default behavior of the application is when you launch it, a blank window is automatically open. This behavior is not that I want. I thought the application should not open any window until users explic

Re: Unread count for items in Mail.app-styled NSOutlineView

2008-03-02 Thread Leonardo Cassarani
I'll look into it, thanks :) On 2 Mar 2008, at 05:25, John Pannell wrote: Hi Leonardo- I implemented a counter that looked the same in a safari-like tabs implementation... http://www.positivespinmedia.com/dev/PSMTabBarControl.html Hope this helps! John __