[Q] about ProjectViewMorph

Ned Konz ned at bike-nomad.com
Wed Sep 10 00:36:19 UTC 2003


On Tuesday 09 September 2003 03:19 pm, David Faught wrote:
> 1. How do I make a ProjectViewMorph that refers to a project stored
> on a server?  I see examples of this all over the place on Bobs
> SuperSwiki, but I don't see how it is done.  The class methods for
> ProjectViewMorph and Project look to me like they mostly expect a
> local project name, not a URL.  Even the Project method fromUrl:
> looks like it only picks the name out of the URL string, it doesn't
> actually use the URL.

You can have a ProjectViewMorph whose project is actually a DiskProxy:

projectName _ 'HitAnyMorph'.
projDir _ ServerDirectory projectServers first.
fileName _ projectName, '.001.pr'.
gifFile _ projDir readOnlyFileNamed: projectName, '.gif'.
gif _ GIFReadWriter formFromStream: gifFile.
p _ ProjectViewMorph new
			image: (gif asFormOfDepth: Display depth);
			lastProjectThumbnail: gif;
			setProperty: #SafeProjectName toValue: projectName;
			project: (DiskProxy 
				global: #Project 
				selector: #namedUrl: 
				args: { projDir fullNameFor: fileName }
			).
p openInHand.

> 2. And for that matter(out of curiosity), if the project is on the
> server, how does the ProjectViewMorph get the thumbnail of it
> (without loading it)?

Look at SuperSwikiServer>>showQueryAsPVM:

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list