Re: lastKeyViewTraversingSubviewsBeginningWithView
On 2/22/10 6:51 PM, Arved von Brasch wrote: Hi Cocoa List, warning: _lastKeyViewTraversingSubviewsBeginningWithView: encountered 5000 views!!! It usually occurs when a NSCollectionView is being refreshed, but not every time. I believe that NSCollectionView creates all of the item views up front, and doesn't lazily create them or destroy them. So, there really are 5000+ subviews. You should take a look at the collection view's subviews to see. -- Joe Ranieri Thanks. It does seem to be the problem. In total, there are over 10,000 (6 per represented object) views being displayed by the Collection View. Is there a hard number written down somewhere that you're not supposed to go over? I haven't been able to find such a warning in the documentation. In trying to save myself Interface Builder work, I have a single NSCollectionView that is used to display two different kinds of objects. I have a NSCollectionView subclass that unbinds itself from one NSArrayController, and then binds itself to the other NSArrayController at runtime to make this work, changing its item prototype at the same time. It worked impressively well with the handful of objects I first tested with, but is quite slow with ~5000 objects. I think I'll have to try separating them out as two different NSCollectionViews as a first step. This makes sense, an NSView has a lot of overhead, relatively speaking. I don't separating them out will help at all, since you'll still have the problem of having 5000 views. Is there any reason to think NSMatrix or IKImageBrowserView (with the associated overhead of image compositing) would be more able to cope with ~5000 objects? NSMatrix might be able to handle this better since it uses NSCells instead of views, but it still doesn't do things lazily (as far as I know). I'm not positive of how IKImageBrowserView does things in terms of efficiency, but I do know it pre-loads the images from your data source. So, if fetching the images is expensive, this could be bad. Your best bet might just to be to write your own that does things lazily and only has enough layers or views for what you need on screen. -- Joe Ranieri ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: lastKeyViewTraversingSubviewsBeginningWithView
On 2/21/10 5:53 AM, Arved von Brasch wrote: Hi Cocoa List, I'm occasionally seeing the following warning from the runtime while testing my application: warning: _lastKeyViewTraversingSubviewsBeginningWithView: encountered 5000 views!!! It usually occurs when a NSCollectionView is being refreshed, but not every time. I've tried Googling for this error with no help, and it doesn't seem to appear in the documentation either. Anyone know what it means, or what the likely cause could be? It doesn't seem to be affecting anything during testing. My test data has just over 5000 items, but the collection view is only ever displaying just over 1000 items. Thanks in advance, Arved I believe that NSCollectionView creates all of the item views up front, and doesn't lazily create them or destroy them. So, there really are 5000+ subviews. You should take a look at the collection view's subviews to see. -- Joe Ranieri ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Preventing system sleep
On 2/16/10 4:10 PM, Neil Allain wrote: On Feb 16, 2010, at 2:57 PM, Laurent Daudelin wrote: I'm working on a an app that at some point might start transferring a large file to a USB device. Apparently, if the system is set to go to sleep, the transfer will fail. I was thinking of using the NSWorkspace extendPowerOffBy: but then the doc says Currently unimplemented. So, if my app get a notification that the system is going to sleep, how can I delay it? You can call UpdateSystemActivity() periodically (such as on a timer) to prevent it from going to sleep. Neil You should probably be using IOPMAssertionCreateWithName() instead if you can require 10.5+. This gives the system a lot more information about the intent of your code and the potential ability to show some nice UI to the user. -- Joe Ranieri ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Preventing system sleep
On 2/16/10 4:18 PM, Laurent Daudelin wrote: On Feb 16, 2010, at 13:13, Joe Ranieri wrote: On 2/16/10 4:10 PM, Neil Allain wrote: On Feb 16, 2010, at 2:57 PM, Laurent Daudelin wrote: I'm working on a an app that at some point might start transferring a large file to a USB device. Apparently, if the system is set to go to sleep, the transfer will fail. I was thinking of using the NSWorkspace extendPowerOffBy: but then the doc says Currently unimplemented. So, if my app get a notification that the system is going to sleep, how can I delay it? You can call UpdateSystemActivity() periodically (such as on a timer) to prevent it from going to sleep. Neil You should probably be using IOPMAssertionCreateWithName() instead if you can require 10.5+. This gives the system a lot more information about the intent of your code and the potential ability to show some nice UI to the user. Oops! The doc says it was introduced in 10.6 and I need to support 10.5. I guess I'll have to check IOPMAssertionCreate... Thanks! Curious. The header file says: IOReturn IOPMAssertionCreateWithName( CFStringRef AssertionType, IOPMAssertionLevel AssertionLevel, CFStringRef AssertionName, IOPMAssertionID *AssertionID) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; Is the header wrong? -- Joe Ranieri ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Touchscreens and control scaling
On Jun 4, 2009, at 03:44, Ben wrote: Hi list, I've been sketching out an application and could do with a little advice on which cocoa-direction to take. It's a full-screen (kiosk) type app, running in a very controlled environment (not for wide release) but which would run on an external touchscreen monitor. While I can make buttons and labels big enough for fingers to poke, I'm concerned about controls like table headers and scrollers being large enough to make finger-size targets. I'm asking sooner rather than after testing the usability in case there are special considerations I should take before writing the first lines of code. The only options I can think of are: 1. Make a normal app and use quartz debug to scale *everything* up 2. Subclass and/or redraw any controls too small for finger taps 3. Shut up and try it out first I don't think option 1 will work well. Apple hasn't done too much to make anything resolution independent. Try running stuff on a non-1.0 scale factor to see. We ended up going with option 2, partially for usability, and partially because we wanted an entirely themed kiosk environment anyways. From my limited testing, some small controls are a problem with a touch screen, but it depends on the accuracy of the touch screen and the ability of your user. -- Joe Ranieri ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Custom drawn menus?
Not up for the menu item route. I am looking at just changing the background and shape slightly or the whole menu to match my UI. Unfortunately there's not much of a good route to go here. Using a custom view requires you to do handle *all* drawing, mouse handling, keyboard events, etc. It is possible to do using an undocumented method, but that's not on-topic for this list. -- Joe Ranieri ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: what the hell is Error (1007) creating CGSWindow?
NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, self.textColor, NSForegroundColorAttributeName, nil]; NSAttributedString* aStr = [[[NSAttributedString alloc] initWithString:str attributes:dict] autorelease]; NSImage* image = [[NSImage alloc] initWithSize:imgSize]; You're leaking this NSImage. -- Joe Ranieri ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Customizing menu drawing
I'm attempting to draw custom menus as part of a kiosk application where normal Mac OS X menus would look out of place. I can customize drawing of the individual menu items using a custom view (through -[NSMenuItem setView:]). However, there remains a region above and below the items where I can't draw. So I'm left with a menu with portions of the aqua appearance, and portions of my appearance - which is definitely not what I'm after. http://sirg3.homeip.net/tmp/menus.png I have a hunch it can be done by dropping down into the Carbon menu manager, but that's not supported and will break in 64-bit... Does anyone have any ideas? -- Joe Ranieri ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: any data on Mac OS X 10.5 install base?
Is there any data on the install base? What is the minimal set of platforms and OS versions that I need to support in order to make any meaningful commercial software There's also Adium's statistics from its auto-updater: http://www.adiumx.com/sparkle/ Joe Ranieri Lead Magician, Alacatia Labs, Inc. http://alacatia.com ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Relaunching an application
Maybe I'm missing something, but Instead of NSTask, why not use LSOpenApplication passing in (kLSLaunchDefaults | kLSLaunchNewInstance | kLSLaunchDontAddToRecents) for flags? Your main program will block until the sub program has launched. Joe Ranieri Lead Magician, Alacatia Labs, Inc. http://alacatia.com ___ 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 cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]