Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > trash

trash
Thread Tools
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Jun 30, 2001, 09:13 AM
 
Anyone how to know from my application if the files in ~/.Trash being removed? Anyone got any sample code.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 30, 2001, 11:20 AM
 
That doesn't make much sense. What do you mean if they are "being removed"?
     
geran  (op)
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Jun 30, 2001, 12:15 PM
 
I means when I empty my trash. I writing a application simular to The Grouch for system 7.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 30, 2001, 06:33 PM
 
When you empty the trash, you want to do what? I'm not familiar with The Grouch. You're not making any sense at all.
     
Mac Elite
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jul 3, 2001, 02:37 AM
 
Okay, I'll bite...

I think English must not be this guy's native language.

Anyway, the Grouch was a neat little extension for System 7 (seven? man, those were the days! ) that had two little sound clips from Sesame Street (an American children's TV show-- is it also in the UK, Angus_D?) of Oscar the Grouch singing something like "I love it because it's trash!" and "oh, I loooove traaash!" IIRC. When you chose to empty the trash, the Trash icon would come to life with an animation of Oscar sticking his head out and singing that first line, and when you confirmed the dialog to empty the trash, he'd sing the second line and sink back into the trashcan.

I don't really know if it's even possible to write something like this for Mac OS X that'd work the same way as it did for Mac OS VII.

[ 07-03-2001: Message edited by: starfleetX ]
The server made a boo boo. (403)
     
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status: Offline
Reply With Quote
Jul 3, 2001, 01:02 PM
 
I remember the Grouch! That was a perfect example of the Mac being better for fun and the "culture" of its user base.

There would be some way of doing something like that. I am not sure specifically how it would work but you could look into the NSNotifications posted by OS events. I seriously doubt that the dock actually deals with emptying the trash yet it knows when it has been emptied so it can change the graphic. The only thing that is questionable is whether you could change the garbage can icon. I don't know if the dock will yield that to you.

Long story short: Check OS NSNotification reference.

Sorry I couldn't have been of more specific help,
Jeff.
Spectral Class
"Shedding Light on Innovation"
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 3, 2001, 01:18 PM
 
Originally posted by starfleetX:
<STRONG>Okay, I'll bite...

I think English must not be this guy's native language.

Anyway, the Grouch was a neat little extension for System 7 (seven? man, those were the days! ) that had two little sound clips from Sesame Street (an American children's TV show-- is it also in the UK, Angus_D?) of Oscar the Grouch singing something like "I love it because it's trash!" and "oh, I loooove traaash!" IIRC. When you chose to empty the trash, the Trash icon would come to life with an animation of Oscar sticking his head out and singing that first line, and when you confirmed the dialog to empty the trash, he'd sing the second line and sink back into the trashcan.

I don't really know if it's even possible to write something like this for Mac OS X that'd work the same way as it did for Mac OS VII.

[ 07-03-2001: Message edited by: starfleetX ]</STRONG>
Yes, we get sesame street over here, I think they even finally bothered making a UK English localised edition because lots of kids learned the alphabet as A to Zee, not A to Zed, and all the spellings were wrong and things.

Anyways, no, you really can't do things like that on OS X. The old hackiness of OS 9 was one of the things that contributed to its instability. Also, this involved modifying and patching other bits of memory, which you really can't do on OS X. The trash is built into the dock (and the finder if you use that old hack, but does it work past the PB?). The only way you could really do it is if you modified the Dock, but since you don't have the source that's nigh on impossible. You could reverse engineer the binary file, but that's against your license agreement. You could probably also write a dock replacement, but that'd be no mean task and probably involve a lot of undocumented API calls.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 3, 2001, 01:53 PM
 
If you just want to know if the trash has been emptied, there might be a way of doing this in Carbon but in Cocoa the closest thing is an NSWorkspace's notification of an NSWorkspaceDidPerformFileOperationNotification (NSWorkspaceDestroyOperation)
     
geran  (op)
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Jul 14, 2001, 01:08 PM
 
Originally posted by Angus_D:
<STRONG>If you just want to know if the trash has been emptied, there might be a way of doing this in Carbon but in Cocoa the closest thing is an NSWorkspace's notification of an NSWorkspaceDidPerformFileOperationNotification (NSWorkspaceDestroyOperation)</STRONG>
Anyone got some sample code how this could be done?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:42 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2