Help - Programming - Menus from menus

Previous - Programming - Next

In fact, it is very easy to make your own menus in Squeak, by making your own buttons or by gathering menus from menus. Here is the result we aim at in the upper part of the gif with bits and pieces under it:

Here are the steps to make your own menus

(1) Get an objects catalogue (Cmd-o with cursor in the Project) and from this grab a Row Morph. It looks like the lower part in the gif, with three colored eggs, and can be found under Presentation.

(2) Pop up some menu, make it remain on the screen (upper right button in menu), put your cursor on a line you want to grab, click up halos repeatedly until the morph you selected is the menu-line (yes, in Squeak objects are inside objects inside objects... and morphs inside morphs inside morphs...) and copy it (with the upper right halo) next to the Row Morph. (I copied open..., flaps... and preferences... from the Worldmenu, but you can select what you please, of course.)

(3) Click up the pick-up halo of the menu-line you just copied and drag the menu-line to the Row Morph. The Row Morph will gobble it up - perhaps after some trying - and you can delete, reshuffle by re-inserting etc. Keep the three eggs for the moment, for Row Morphs gobble up morphs dropped on them when largish.

(4) Repeat with other menu lines from other menus you want to gather into your own menu.

(5) add some of your buttons such as
FileList2 and Grab Screenpart.

(6) Remove the items in the Row Morph you don't want, such as the eggs. (It is easier to keep them when adding menu-lines, for then it is easier to make it accept items, due to size.)

(7) Colour your menu as you like e.g. red, and name it as you like, such as MyOwnMenu (it will display this name when collapsed).

Task accomplished!

Extra's:

- You can put your own menus inside their own SystemWindow, as you learned in Fancy Editor
- You can add your own Fancy Editor with your own Explanations
- You can instead of a RowMorph use a ColumnMorph (also in the objects catalogue)
- You can add some of the Wordmenu - new morph - grab... options for working with pictures.

Previous - Programming - Next