Re: Change the NSPreferencePane window size programmatically
On Fri, Jan 7, 2011 at 6:09 AM, eveningnick eveningnick eveningn...@gmail.com wrote: I was thinking that my pane is operating in the address space of System Preferences, which means i can send messages to objects of this application. Can i somehow retrieve the object of main window and send it something like -setFrame ? Don't ever do that. There's no guarantee of this. Your preference pane can be loaded by any application, and there's nothing keeping a future version of System Preferences from loading your pane in a sandbox. Objects outside your own preference pane are not yours to touch. --Kyle Sluder ___ 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: Change the NSPreferencePane window size programmatically
Kyle, thanks for the warning, i understand the problems it may cause. but what if i was doing that, how should have i sent a message to an object of the host application? ___ 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: Change the NSPreferencePane window size programmatically
On Fri, Jan 7, 2011 at 10:42 AM, eveningnick eveningnick eveningn...@gmail.com wrote: Kyle, thanks for the warning, i understand the problems it may cause. but what if i was doing that, how should have i sent a message to an object of the host application? Quite simple: you don't. Ever. If your host object doesn't explicitly give you an object you're allowed to message, you don't message any of its objects. --Kyle Sluder ___ 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: Change the NSPreferencePane window size programmatically
Whatever you do to an app that isn't yours: use the APIs supplied for Interapplication Communication, as there are (among others): AppleEvents, AppleScript, Accessibility... These ensure sufficient isolation between the objects involved, and they are (to a certain extend) likely to survive the next OS version. These APIs DO give you objects you're allowed to message, and they implement messages you're allowed to send to these objects. Look at this simple AppleScript: tell application System Preferences set bounds of window 1 to {342, 125, 937, 585} end tell It's very easy to send this via NSAppleScript. So what makes you look for dirty hacks? Peter Am 07.01.2011 um 19:51 schrieb Kyle Sluder: On Fri, Jan 7, 2011 at 10:42 AM, eveningnick eveningnick eveningn...@gmail.com wrote: Kyle, thanks for the warning, i understand the problems it may cause. but what if i was doing that, how should have i sent a message to an object of the host application? Quite simple: you don't. Ever. If your host object doesn't explicitly give you an object you're allowed to message, you don't message any of its objects. --Kyle Sluder ___ 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