How to improve Squeak (BookMorph)

lex at cc.gatech.edu lex at cc.gatech.edu
Thu Jul 15 17:30:06 UTC 2004


Okay, I withdraw my objection.  Fix up BookMorph, anyone who is
interested, especially if it is just minor tweak.  However, the general
issue remains: we have two UI's that do the same sort of stuff but are
missing key functionality in different areas.  Since we seem to have no
one who is champonioning the overall UI, we end up with inconsistencies
like this.  But also, given a lack of UI champion, I guess we may as
well keep things going as long as possible.  And heck, maybe BookMorph's
win out in the end and it's project threads that go away.


On specific issues, let me toss in half a cent, rounded down.

=?ISO-8859-1?Q?st=E9phane_ducasse?= <ducasse at iam.unibe.ch> wrote:
> But I got stuck when 
> doing exactly this kind of loops because the code is much much more 
> complex.

Okay, there is a problem in that if you save a project, it will kill
your thread; thus, it is hard to keep saving it.  However, it only
*needs* to kill the thread if you are saving the current project.  (And
maybe even that is not necessary, but I haven't looked closely enough.) 
Thus, it is sufficient to save the current project last, and to tweak
the project-saving machinery to only kill your thread if you are saving
the current project.

So here's an updated saveAllInThread:

saveAllInThread
	| leftover |
	listOfPages do: [ :pageInfo |
		| project |
		project _ (Project named: pageInfo first).
		project isCurrentProject
			ifTrue: [ leftover _ project ]
			ifFalse: [ project storeOnServer ] ].
		
	"save the current project last, because saving the current project will
kill the current thread"
	leftover ifNotNil: [ leftover storeOnServer ].
	

Also, you need to add the following to the beginning of
armsLengthCommand:withDescription: :

	self isCurrentProject ifFalse: [
		^self perform: aCommand ].
	
And it's still not quite what is desired: this saves all the projects
including ones that have not changed.


> Just to mention one of the things you can do with a BookMorph which I
> do not know how to do with a labyrinth of projects:  
> (Control-Left Mouse Click)(book...)(search for text)

True, that's not in there that I know of.  It should be easy to do,
however.


Stef wrote:
> I agree with you and I'm thinking to see how we can program a 
> clean/simpler/bookmorph with TESTS.  the active documentation. ;)

With respect, before you can write a test, you have to know what the
desired behavior is....


-Lex



More information about the Squeak-dev mailing list