Re: Adding GUI components dynamically

2008-03-01 Thread Dimitri Bouniol
Easy. Create an instance of a NSButton: NSButton *myButton = [[NSButton alloc] initWithFrame:nsRectOfButton]; Then add it to your view: [view addSubview:myButton]; of course you might want to edit the image, title, style of the button, so check in NSControl and NSButton docs for the

Unread count for items in Mail.app-styled NSOutlineView

2008-03-01 Thread Leonardo Cassarani
Hi all I'm trying to make a lateral sidebar that is similar to Mail.app's or iTunes'. It all works well with a NSOutlineView with the Data source display option, but I was wondering how could I get the single items to draw the equivalent of the unread count for folders in Mail.app's

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

2008-03-01 Thread Stéphane Sudre
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 of just iterating through the item hierarchy when

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

2008-03-01 Thread j o a r
On Mar 2, 2008, at 12:02 AM, Stéphane Sudre wrote: An I missing something and is there a way to know which items are expanded (either visible or not)? How about NSOutlineViewItemWillExpandNotification NSOutlineViewItemWillCollapseNotification, and the associated delegate methods? j

Problems with ScriptingBridge and iTunes

2008-03-01 Thread Hannes Petri
Hello! 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.iTunes];

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

2008-03-01 Thread John Stiles
Unless Stephane plans on manually tracking the expanded items himself, I don't see how this answers his original question—and I think it's a valid question, too. j o a r wrote: On Mar 2, 2008, at 12:02 AM, Stéphane Sudre wrote: An I missing something and is there a way to know which items

Re: NSMachPort thread safety

2008-03-01 Thread Adam R. Maxwell
On Mar 1, 2008, at 8:35 PM, Kyle Sluder wrote: On Sat, Mar 1, 2008 at 9:01 PM, Adam R. Maxwell [EMAIL PROTECTED] wrote: Thanks, but I think you're misinterpreting the example :). The object has a single NSMachPort ivar, added to the some thread's runloop. When a notification arrives on a

Re: Problems with ScriptingBridge and iTunes

2008-03-01 Thread Jonathan 'Wolf' Rentzsch
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]]) { … } The problem is,