Re: Updating Trash icon
Re: Updating Trash icon
- Subject: Re: Updating Trash icon
- From: Prachi Gauriar <email@hidden>
- Date: Sun, 01 Jun 2003 23:45:07 -0500
On Sunday, June 1, 2003, at 11:30 PM, Chad Armstrong wrote:
Is there a way to tell the Trash icon in the dock to update/refresh
itself from a Cocoa application? If I put or remove something into
the ~/.Trash directory, the icon will not update itself in the Dock
until I click on the icon.
I think you're interested in NSWorkspace's noteFileSystemChanged:
method. According to the docs:
- (void)noteFileSystemChanged:(NSString *)path
Informs NSWorkspace that the file system specified by path has
changed. NSWorkspace then gets the status of all the files and
directories it is interested in and updates itself appropriately. This
method is used by many objects that write or delete files.
So this should work fine:
[[NSWorkspace sharedWorkspace] noteFileSystemChanged:[@"~/.Trash/"
stringByExpandingTildeInPath]];
-Prachi
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.