ExportPicture fails on 10.10

Kind of baffled on this. I have a code that has the option to save an image as a picture using the ExportPicture routine. Works fine on 10.9 and older, Windows 7, but on 10.10 (Yosemite), in both IDE and compiled, nothing happens–I don’t see the file save dialog. When I try stepping into it in the debugger (so at a command “outcome=ExportPicture§”) the next thing that comes up is, essentially, nothing (I get a LostFocus from a TextField if the cursor had been in there, otherwise just kicked into a timer event that only fires every 150 ms. If I put a break on the statement after the ExportPicture call, I never hit that statement. Any ideas?

xojo 2015 2.1, OSX 10.10.3

same result as you have

Nice to know I am not unique, but, oddly, one of my codes does still have this work. Hmmm. It does not have a timer, but not sure that has anything to do with this. (Works for this one both compiled and IDE). And 10.10.3 and 2015 2.1 (but saw this in 2015 1.0 too).

Do you see any messages in Console about exceptions?

Ah, yes. Here it is. I am not sure of the meaning of the ‘advice’ (“Should translate autoresizing mask into constraints if _didChangeHostsAutolayoutEngineTo:YES”).

5/5/15 3:27:42.404 PM GravMag[27282]: GetDYLDEntryPointWithImage(/System/Library/PrivateFrameworks/CacheDelete.framework/CacheDelete,CacheDeleteCopyPurgeableSpaceWithInfo) failed.
5/5/15 3:27:42.473 PM GravMag[27282]: *** Assertion failure in -[IKSaveOptionsContainer _didChangeHostsAutolayoutEngineTo:], /SourceCache/AppKit/AppKit-1347.57/Layout.subproj/NSView_Layout.m:577
5/5/15 3:27:42.476 PM GravMag[27282]: An uncaught exception was raised
5/5/15 3:27:42.476 PM GravMag[27282]: Should translate autoresizing mask into constraints if _didChangeHostsAutolayoutEngineTo:YES.
5/5/15 3:27:42.561 PM GravMag[27282]: (
0 CoreFoundation 0x9ae37c63 __raiseError + 195
1 libobjc.A.dylib 0x9998ba2a objc_exception_throw + 276
2 CoreFoundation 0x9ae37aea +[NSException raise:format:arguments:] + 138
3 Foundation 0x930a088f -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 118
4 AppKit 0x9a1cb118 -[NSView(NSConstraintBasedLayout) _didChangeHostsAutolayoutEngineTo:] + 161
5 AppKit 0x9a1b9d32 -[NSView(NSConstraintBasedLayout) _setHostsAutolayoutEngine:] + 131
6 AppKit 0x9a1ba552 -[NSView(NSConstraintBasedLayout) _engageAutolayout] + 101
7 AppKit 0x9a1ba552 -[NSView(NSConstraintBasedLayout) _engageAutolayout] + 101
8 AppKit 0x9a1ba3c0 -[NSView(NSConstraintBasedLayout) _tryToAddConstraint:integralizationAdjustment:mutuallyExclusiveConstraints:] + 121
9 AppKit 0x9a1ba338 -[NSView(NSConstraintBasedLayout) nsli_addConstraint:] + 234
10 AppKit 0x9a1ca99e -[NSView(NSConstraintBasedLayout) addConstraint:] + 40
11 AppKit 0x9a20a2dc -[NSView(NSConstraintBasedLayout) _updateContentSizeConstraints] + 640
12 AppKit 0x9a20a03d -[NSView updateConstraints] + 95
13 AppKit 0x9a209c9f -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 641
14 AppKit 0x9a209bc9 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 427
15 AppKit 0x9a209bc9 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 427
16 AppKit 0x9a209bc9 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 427
17 AppKit 0x9a209bc9 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 427
18 AppKit 0x9a209bc9 -[NSView _updateConstraintsForSubtreeIfNeededCollectingViewsWithInvalidBaselines:] + 427
19 AppKit 0x9a209963 __45-[NSView updateConstraintsForSubtreeIfNeeded]_block_invoke + 53
20 AppKit 0x9a05d735 -[NSView(NSConstraintBasedLayout) _withAutomaticEngineOptimizationDisabled:] + 111
21 AppKit 0x9a209927 -[NSView updateConstraintsForSubtreeIfNeeded] + 98
22 AppKit 0x9a209874 __62-[NSWindow(NSConstraintBasedLayout) updateConstraintsIfNeeded]_block_invoke + 164
23 AppKit 0x9a05d735 -[NSView(NSConstraintBasedLayout) _withAutomaticEngineOptimizationDisabled:] + 111
24 AppKit 0x9a209783 -[NSWindow(NSConstraintBasedLayout) updateConstraintsIfNeeded] + 298
25 AppKit 0x9a22d7d4 -[NSWindow(NSConstraintBasedLayout) layoutIfNeeded] + 36
26 AppKit 0x9a16dbe3 -[NSWindow _setUpFirstResponderBeforeBecomingVisible] + 63
27 AppKit 0x9a29dd81 -[NSApplication _orderFrontModalWindow:relativeToWindow:] + 727
28 AppKit 0x9a29d6c1 -[NSApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:] + 913
29 AppKit 0x9a29d320 -[NSApplication beginModalSessionForWindow:] + 72
30 AppKit 0x9a29d1c9 -[NSApplication runModalForWindow:] + 138
31 AppKit 0x9a75f621 -[NSSavePanel runModal] + 474
32 XojoFramework 0x005b1c2c rnd + 2778
33 XojoFramework 0x005c1f4c exportPicture + 27
34 GravMag 0x001775ba GravMag + 1533370
35 GravMag 0x0036c7ee GravMag + 3586030
36 XojoFramework 0x005b5d0f RuntimeMenuItemLookupArray + 1617
37 XojoFramework 0x004fa66e RuntimeCompareAuto + 20082
38 XojoFramework 0x004fab2a RuntimeCompareAuto + 21294
39 libobjc.A.dylib 0x99989853 -[NSObject performSelector:withObject:] + 70
40 AppKit 0x9a2987ee __36-[NSApplication sendAction:to:from:]_block_invoke + 51
41 libsystem_trace.dylib 0x99721c03 _os_activity_initiate + 89
42 AppKit 0x9a298707 -[NSApplication sendAction:to:from:] + 602
43 AppKit 0x9a2983ad -[NSMenuItem _corePerformAction] + 479
44 AppKit 0x9a29809e -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 162
45 AppKit 0x9a29771a -[NSMenu _performActionWithHighlightingForItemAtIndex:sendAccessibilityNotification:] + 79
46 AppKit 0x9a369e3b __38-[NSMenu performActionForItemAtIndex:]_block_invoke + 52
47 libsystem_trace.dylib 0x99721c03 _os_activity_initiate + 89
48 AppKit 0x9a369dff -[NSMenu performActionForItemAtIndex:] + 141
49 AppKit 0x9a369d5e -[NSMenu _internalPerformActionForItemAtIndex:] + 45
50 AppKit 0x9a369d29 -[NSMenuItem _internalPerformActionThroughMenuIfPossible] + 106
51 AppKit 0x9a369b82 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 120
52 AppKit 0x9a27f0b7 NSSLMMenuEventHandler + 679
53 HIToolbox 0x92a035a4 _Z22_InvokeEventHandlerUPPP25OpaqueEventHandlerCallRefP14OpaqueEventRefPvPFlS0_S2_S3_E + 36
54 HIToolbox 0x92841681 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 2291
55 HIToolbox 0x9284065c _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 402
56 HIToolbox 0x92854f25 SendEventToEventTarget + 88
57 HIToolbox 0x92a03422 _ZL18SendHICommandEventmPK9HICommandmmhPKvP20OpaqueEventTargetRefS5_PP14OpaqueEventRef + 447
58 HIToolbox 0x928c727c SendMenuCommandWithContextAndModifiers + 72
59 HIToolbox 0x928c7220 SendMenuItemSelectedEvent + 207
60 HIToolbox 0x928c70db ZL19FinishMenuSelectionP13SelectionDataP10MenuResultS2 + 145
61 HIToolbox 0x92a55517 _ZL14MenuSelectCoreP8MenuData5PointdmPP13OpaqueMenuRefPt + 775
62 HIToolbox 0x928c787b _HandleMenuSelection2 + 512
63 HIToolbox 0x928c7665 _HandleMenuSelection + 55
64 AppKit 0x9a1907f6 _NSHandleCarbonMenuEvent + 359
65 AppKit 0x9a0bfae9 _DPSNextEvent + 1710
66 AppKit 0x9a0bedc5 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 350
67 XojoFramework 0x0050e6e0 ParseJSON + 12626
68 XojoFramework 0x0050e746 ParseJSON + 12728
69 GravMag 0x0000ba65 GravMag + 43621
70 GravMag 0x0008401e GravMag + 536606
71 XojoFramework 0x0063523a SSLSettings_SetValidateCertificates + 1002
72 XojoFramework 0x0050e66f ParseJSON + 12513
73 AppKit 0x9a0b377c -[NSApplication run] + 907
74 XojoFramework 0x006352b7 SSLSettings_SetValidateCertificates + 1127
75 XojoFramework 0x0063384c RuntimeRun + 49
76 GravMag 0x0017b5e3 GravMag + 1549795
77 GravMag 0x000051fb GravMag + 16891
78 GravMag 0x00002640 GravMag + 5696
79 GravMag 0x0048b9ce GravMag + 4762062
)

Please file a bug report in Feedback. It sounds like Apple changed how save panels work which broke ExportPicture.

It’s strange. in a new project, it will not work.
When I add it to an existing project ( as Menu - Export Picture) it works

Test

In my case, ExportPicture has been in several existing projects but fails in some-but not all.

BTW, a bug report is filed (39222 - ExportPicture fails in Mac OS 10.10). Made a small demo of the failure (just added ExportPicture to the DragPicture example code).

For OS X, you can use either the MBS plugin or some declares to convert the picture to a CGImage and then create a CGImageDestination and use that to save your image in not only a variety of file formats, but all kinds of other options.

ExportPicture handles all of that via a system-provided save panel accessory view.

Except it doesn’t at the moment, cause Apple broke it :frowning:

Basically.