Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing a Dock preference



My app is a Dock-style launcher thingy and as such, I want a preference in
it which allows the user to turn on the Dock's Auto-hiding without having to
get them to do it manually via the Dock's own preferences.

After much poking around, I came up with this:

CAutoCFString_AC key("autohide");
CAutoCFString_AC theDock("com.apple.dock");
CFBooleanRef val = hideDock_i ? kCFBooleanTrue : kCFBooleanFalse;
CFPreferencesSetValue(key, val, theDock, kCFPreferencesCurrentUser,
kCFPreferencesAnyHost);
CFPreferencesAppSynchronize(theDock);

CFNotificationCenterRef center = CFNotificationCenterGetDistributedCenter();
CFStringRef observedObject = CFSTR("com.apple.dock");

CFNotificationCenterPostNotification (center,
CFSTR("com.apple.dock.prefchanged"),
observedObject,
nil, true);


But alas it does not work.

Anyone got any ideas why it doesn't work, or if their is a better way?

Matt Gough
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.