Basically I have an image preview window (that is simply bound to some data in my controller)... the size and brightness/control/saturation of the image can be changed with sliders... when a slider value is changed, the image data is updated (this is the operation that takes some time that I launch with an NSInvocationOperation, I will call it generateNewPreview: )... and then the image preview is updated and re- sized to accommodate the new image size (by calling resizePreviewWindow: )

Since I don't want to block the UI while the new image is generated, I am using an NSInvocationOperation to generate the new image... however since the resizePreviewWindow: method is dependent of the generateNewPreview operation (because I need to know the size of the newly generated image before I can re-size my preview window), I am not sure on how/when I should be calling the resizePreviewWindow method...

I tried waiting for the generateNewPreview: operation to complete before re-sizing but obviously this beats the purpose of using an NSOperation in the first place since it locks my UI while it waits for the opeation to complete.... I tried making resizePreviewWindow: a second operation that is dependent on the generateNewPreview: operation, my app kept crashing... I can get it to work if I simply call resizePreviewWindow: at the end of the generateNewPreview: operation, however it seems to be causing a drawing problem (the preview window becomes white while it gets re-sized and overall it looks bad)... I tried to perform resizePreviewWindow on the main thread, no luck either...

Am I looking at this the wrong way?? To sum it up, my generateNewPreview operation is the operation that takes time, resizePreviewWindow depends on it (but also takes time since the re- sizing is animated) and I have to keep in mind that the user should be able to mess with the size/brightness etc sliders even while those operations are running...


Jean-Nicolas Jolivet
[EMAIL PROTECTED]
http://www.silverscripting.com

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to