Can I get a "image save" notification?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I get a "image save" notification?

HwaJong Oh
My program wants to detect image save event. I couldn't find one, so changed SmalltalkImage>>logChanged: or SmalltalkImage>>addSnapshot:andQuit: to detect the image save and fire my custom notification.

Is there a good for doing this like SystemChangeNotification or SystemAnnouncement?

HwaJong
Reply | Threaded
Open this post in threaded view
|

Re: Can I get a "image save" notification?

Mariano Martinez Peck


On Sat, Apr 21, 2012 at 10:47 AM, HwaJong Oh <[hidden email]> wrote:
My program wants to detect image save event. I couldn't find one, so changed
SmalltalkImage>>logChanged: or SmalltalkImage>>addSnapshot:andQuit: to
detect the image save and fire my custom notification.


That makes sense.
 
Is there a good for doing this like SystemChangeNotification or
SystemAnnouncement?


The good solution I guess it would be SystemAnnouncement.
Anyway, if you want a dirty solution without changing the system, you can have your custom class that adds itself to Smalltalk shutDownList
and then it implements #shutDown: 
this will be called also when saving the image. See senders of #processShutDownList:
 
Cheers

HwaJong


--
View this message in context: http://forum.world.st/Can-I-get-a-image-save-notification-tp4576118p4576118.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: Can I get a "image save" notification?

HwaJong Oh
Reporting shutDown: startUp: experiments.


#Save
shutDown: false
<write files>
startUp: false

#Save as
shutDown: false
<write files>
startUp: false

#Save and Quit
shutDown: true
<write files>
startUp: true

#Quit
shutDown: true
Reply | Threaded
Open this post in threaded view
|

Re: Can I get a "image save" notification?

nasca
hi ,
 have you already worked this out?I succeed doing that with image save component found by google.
if you got any confusion ,you can turn to it directly.
Sample codes and creating guide are avaliable here. Good luck.