I'm trying to change the size of the pasteboard in code, in the same way that a user would change it via Guides and Pasteboard Preferences.
The code I have at the moment seems to change the values displayed in the preferences dialog for "Horizontal margins" and "Vertical margins", but doesn't actually change the visible pasteboard.
Any ideas on what I'm doing wrong?
IDocument* doc = Utils<ILayoutUIUtils>()->GetFrontDocument();
InterfacePtr<IPasteboardPrefs> pasteboardPrefs(static_cast<IPasteboardPrefs>(::QueryPreferences(IID_IPASTEBOARDPREFERENC ES, doc)));
pasteboardPrefs->SetPasteboardBorder(newXVal, newYVal);
I've also tried an "apply" command I found, in follow up to the above code, but it made no difference:
InterfacePtr<ICommand> setPasteboardCmd(CmdUtils::CreateCommand(kSetPasteboardPrefsCmdBoss));
if (setPasteboardCmd) {
CmdUtils::ProcessCommand(setPasteboardCmd);
}
Thanks in advance