> I'm only allowed to hit Photoshop callbacks from within the thread that
> Photoshop calls me with.

I don't have the PS SDK, so can't play along at home... In consequence, 
anything I say is likely to be bogus or at best misleading - be advised!


> In the past, I've used pure Win32 calls under Windows and had no problem
> (as it is the underlying API beneath EVERYTHING).  On the Mac none of this
> seems to be an issue.

Yes, the way WinXX and OSX handle dynamic linking are quite different, so I'm 
not surprised they behave differently.

Shame you don't have a Linux implementation to try too - get a third opinion on 
it!



> It MIGHT be possible to do what you suggest in a separate thread, but
> Photoshop has essentially yielded it's thread to me and I should be able
> to do anything I want.  The problem appears to be one of re-entrancy.  The
> UI comes up the first time just fine.  It's the second time that it
> examines its navel.

Hmm, there's a thing; the thread that PS passes to you, is it in fact the 
"main" thread of the application? So PS is "paused" in the background whilst 
all this is going on?

But I do think that the issue seems to be related to the way that PS is 
"retaining" the fltk DLL after the first run of your pop-up, so that subsequent 
runs are not initialised correctly.
What, exactly, is not initialised though I am struggling to say... Matt or 
Albrecht might have more ideas. (Probably everyone is on holiday right now, 
except maybe Greg and I...!)


> But your approach is worth trying.  I can spawn a new thread for the UI
> after copying the image out of Photoshop.  Let me give that a shot.

I'd be cautious there - creating and showing windows (well, GUI structures in 
general) from a "non-main" thread can be fragile on some WinXX variants (and 
generally does not work at all on OSX) which is why I wondered if the thread 
context you are passed from PS is actually the "main" thread...

Greg's idea was to spawn a fully independent process rather than a subsidiary 
thread, which would resolve the re-entrancy issues by tearing down and 
recreating the worker process on every iteration... But then the IPC becomes a 
pain, especially if you have to move a lot of memory (I am assuming image 
editing type operations here...) between processes.

How well does shared memory between processes work on Win32? I do not know...





SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to