What happened to DVS refresh button?
Stephen Pair
spair at acm.org
Tue Dec 3 19:54:54 UTC 2002
Avi Bryant wrote:
> Well, if you file in new packages via the Load button instead
> of through the file list, you don't need to refresh button
> (and you get the added advantage that the directory path is
> set for you).
How about adding code like the following to register a package on
file-in:
----
"Register the DVS package"
| dir currentContext |
currentContext _ thisContext.
[currentContext home receiver class == StandardFileStream]
whileFalse: [currentContext _ currentContext sender].
dir _ (currentContext home receiver) directory.
Smalltalk at: #FilePackageManager ifPresent:
[:p | (p registerPackage: '<package name>') directory: dir]!
----
This would get the correct directory path for the . It's a little hacky
I admit, but it works (I got this from Craig's Flow installer). A
better solution would be to have the file-in mechanism bind some
variable (like self) to a file-in manager or something (similar to the
SAR installer)...from there you could get at the file name (and path).
Also, why not make #registerPackage: notify any open Package UIs? You
could use a loosely coupled dependency mechanism (to avoid creating an
un-necessary code dependency).
- Stephen
More information about the Squeak-dev
mailing list
|