[squeak-dev] Re: Menu structure (Re: The Trunk: System-mha.167.mcz)

Balázs Kósi rebmekop at gmail.com
Fri Nov 20 11:30:08 UTC 2009


Hi,

> * Having TheWorldMainDockingBar updateInstances automatically is too
> aggressive. We should do this via an #initialize method which can be touched
> as needed and will only be executed when we have to. The way it is right now
> makes it very hard to add new stuff that temporarily break things (I break
> stuff all the time :-)
I added a preamble to Morphic(-kb.241) to unsubscribe TheWorldMainDockingBar
from SystemChangeNotifier. Now TheWorldMainDockingBar initialize updates
the docking bar.

> * For consistency I think we should be using the same pattern that is
> generally utilized via MenuMorph>>addList:, i.e.
>
> squeakMenu
>        ^{
>                {'About' translated. #aboutSqueak}.
>                {'Update translated. #updateSqueak}.
>                -.
>                {'Save Image' translated. #saveImage}.
> ...
>
> instead of the custom scheme you've been using. I think this way it's more
> recognizable.
I dropped the descriptor array scheme to build the menus. Now things
are a bit more
verbose, but more straightforward and flexible, i think. e.g.:

	...
	item addSubMenu: [ :menu |
		self
			aboutMenuItemOn: menu;
			updateMenuItemOn: menu.
		menu addLine.
		self saveMenuItemOn: menu
		...

saveMenuItemOn: menu

	menu addItem: [ :item |
		item
			contents: 'Save Image' translated;
			help: 'Save the current state of Squeak on disk' translated;
			icon: MenuIcons smallSaveIcon;
			action: [ SmalltalkImage current snapshot: true andQuit: false ] ]

> * The Projects menu should come before the Tools menu and should include a
> submenu for "New Project" listing all the available types of projects (i.e.,
> Project allSubclasses). (I can help you with this)
I added the submenu to the New Project item and kept its default
action to open a
MorphicProject.

> * We definitely also need a Help menu which should include things like the
> command key help (shortcuts), probably a window with additional resources
> (i.e., links to the free Smalltalk books) a quick reference card for syntax.
> Any takers?
I added a stub for it: TheWorldMainDockingBar >> helpMenuOn:
This could also be the place to add tutorial projects to teach
programming kids of
all ages.

> * The menu items should have a few pixel additional vertical spacing.
I added 2 pixels to MenuItemMorph >> minHeight. It's easier on the eyes, but
the world menu doesn't fit anymore on my 600px tall screen. Is this
ok, or should
we only pad menu items in the docking bar?

> * There seems to be a bit inconsistency about how to shake off an open menu
> depending on how exactly you mouse over / in / out. I haven't been able to
> make this happen reliably but in some situations it won't go away.
Yeah, there are glitches, i'll try to hunt them down.

> * Finally, I'm not sure but the TheWorldMainDockingBar seems to be a
> singleton. It shouldn't - we can have different menus for different kinds of
> projects, and one of the first things I'm going to try to do is to make an
> EtoysProject subclass of MorphicProject which wouldn't contain the various
> Tools but rather replace them by an Authoring menu.
It is. But it has no state, just builds and updates DockingBarMorphs.
We should rename it to DockingBarBuilder or something.
We can subclass it, override it here and there, and make the project decide
which subclass to use.

This is just the start, highly experimental. There are lots of space
to improve and for cleanup.
Any suggestions on content, behaviour and implementation are welcome!

Balázs

p.s.: What should we do with preferences like tinyDisplay, noviceUser
and the like governing Morphic? For me the easiest thing seems to get
rid of them :)



More information about the Squeak-dev mailing list