Re: Change the NSPreferencePane window size programmatically
Re: Change the NSPreferencePane window size programmatically
- Subject: Re: Change the NSPreferencePane window size programmatically
- From: Peter Lübke <email@hidden>
- Date: Fri, 7 Jan 2011 22:40:09 +0100
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
<email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden