I was getting frustrated with accidentally deleting objects, so I decided it would be a good thing(tm) for me to implement my last proposal. It ended up being very easy (I'm getting much better at Self, and it's so much easier to use now that I finagled access onto an UltraSparc 167:).
It works perfectly, to add a dismiss warning to an object, all I have to do is add a slot "deleteWithoutWarning = false". Unfortunately, I have no way to share this work because I can't seem to figure out how to get a module to include a complex morph. Any hints? All the code comes across fine, but the actual morph I use for the dialog box doesn't (I can't userQuery because of some locking problem).
--Toby Everett
Tobermory Everett wrote:
I was getting frustrated with accidentally deleting objects, so I decided it would be a good thing(tm) for me to implement my last proposal. It ended up being very easy (I'm getting much better at Self, and it's so much easier to use now that I finagled access onto an UltraSparc 167:).
Nothing like practice :-)
It works perfectly, to add a dismiss warning to an object, all I have to do is add a slot "deleteWithoutWarning = false". Unfortunately, I have no way to share this work because I can't seem to figure out how to get a module to include a complex morph. Any hints? All the code comes across fine, but the actual morph I use for the dialog box doesn't (I can't userQuery because of some locking problem).
I can't help you with the module thing, but I would like to comment on the whole idea of asking the user to confirm an action. This isn't the best solution - it becomes a part of dimissing and you'll end up clicking on "yes" before you realize you didn't want to get rid of it after all.
Wouldn't it be better to push the dismissed morphs into a fixed size (lets say 3) STACK and have a global menu item to retrieve the last one? A little like the trash can in the Macintosh (there is supposed to be a trash can in Kansas too, but I never saw it yet...).
-- Jecel
on the whole idea of asking the user to confirm an action. This isn't the best solution - it becomes a part of dimissing and you'll end up clicking on "yes" before you realize you didn't want to get rid of it after all.
Wouldn't it be better to push the dismissed morphs into a fixed size (lets say 3) STACK and have a global menu item to retrieve the last one? A little like the trash can in the Macintosh (there is supposed to be a trash can in Kansas too, but I never saw it yet...).
There is indeed a trash can in the release; it may not be present in the tutorial snapshot though.
In fact, I implemented this very behavior for "delete" for myself. I'll try to find the bits of code I added for this--very few lines overall. Shift-right clicking* on an object causes it to zip over to the trash can icon and get sucked in. (The zip is animated, but the suck isn't yet... any takers?) The delete menu item is renamed "throw away".
*yeah, shift is a hack.
Bay
trashCanMorph is the prototype; it's in the snapshot, but there isn't a copy manifest in the default world. To get one, send copy to the prototype and use the "show morph" menu item on the outliner.
My recollection is that it has a strange implementation which precludes it being added to the morph factory.
-Mario
self-interest@lists.selflanguage.org