Icon Power!

We're used to icons on the desktop so why not in menus?
Because it's tricky, that's why!
George Crissman has put together this ResourceMaster tutorial which makes it easy - allegedly!

Recreational programmers don't have to worry about deadlines which leaves us free to do the unthinkable
without worrying about petty annoyances like the project specification, the boss, or job security.

This icons in menus idea falls into the unthinkable category but since text entry in drop down menus are "objects" it seems reasonable to be able to substitute an alternative "object" such as an icon - right?

Happily it is possible using a copy of ResourceMaster, included on the AC#6 Reader Disk, and an in-process menu.

Step by step

Because resource file development is a highly visual process we'll use illustrations and start with a completed text menu.
If you're not sure how to create the text menu refer to the boxout.

Installing an icon

To keep it easy, icons should be installed as the menu bar is created.
Our existing file has already established the File menu.
Since Print will be changed we'll stop menu development temporarily,
close the editing window to return to the ResourceMaster desktop and save the work already completed.


 Single click the MENU icon, then select File>Information for statistics.

Change the menu object into a dialog object by selecting the Dialog bubble, then OK. The icon representing your menu has changed to FORM. Double-click to re-open the menu for more editing!

This nightmare of overlapping menus, caused by changing the menu into a form, is exactly what we need.
This is why it's easier to install the icons during menu construction rather than later!

Drag the Print entry to the Wastebin, leaving a hole in the menu.

Position the mouse in the menu opening and [Shift] left-click to edit the size of the menu. Be careful! Accidentally clicking on an entry will edit the size of the entry, not the menu!

For an icon, increase Height by 16 (or other multiple of 8) followed by OK then drag the Quit and separator objects down to make room for the icon.

Right-click to display the Dialog toolbox, select an icon object and drag it into place dropping it in the empty space. Double-click the icon to call the editor.

Name the icon, edit the entry, then edit the icon to look like a printer.
Be sure to leave 16 blank pixels to the left of the icon (OK so I forgot!) for alignment purposes then select OK.

The easy part

Close the window containing the edited menu. select the FORM icon and use the File>Information dialog to change Dialog back to a Menu then select OK to save your work. Congratulations! You've added your first icon to a drop-down menu!

Continue with the next drop-down menu (Edit) along with its entries and add any desired icons as you go. Repeat this procedure until the menu bar is complete.

Limitations

From a programming standpoint, icons in menu bars can be treated just like a text item. It can be checked (if you remembered to leave 16 blank pixels to the left of the icon), crossed out and all the other options available using the menu_icheck() and objc_change() calls.

However, not all standard dialog techniques work in menus. Installing radio buttons on top of an invisible-box in the menu is not supported. Although they may be added during the editing process, the Menu choice will be De-selected (greyed out) when attempting to change back from Dialog.

Remember to save your work frequently, especially when attempting risky changes such as attempting to "out-fake" the resource construction set with some exotic object.

Wanna Play?

There's no need to stop with icons! It may be possible to add coloured, formatted text objects to spruce up the appearance of your program. Editable text fields in menus anyone? Anyway, have fun, and be sure to let us know if you make any cool discoveries...



Creating the text menu

Generating the text style menu structure is quick and straightforward using ResourceMaster. Unless otherwise instructed use the left mouse button. After launching ResourceMaster:

 

 

Thinking Out Loud

Some new GEM commands related to the menu bar should offer greater creativity in screen usage,
for example:
 
 

 

Although these commands may affect other GEM commands (wind_get(DESK,...) springs to mind), they might just inspire programmers to try out some interesting alternatives to plain text menus.


 On the Reader Disk

FLOWCHART.PRG
A dummy program created by George Crissman to illustrate icons in menus. Tested on TOS/GEM, Mint/MultiTOS, and MagiC.


About The Author

George Crissman has been a "recreational programmer" since obtaining a 520STM
early ST model with no internal floppy drive) using Mark Williams C.
He currently uses a Falcon and Lattice C.
 


Homeless icon finds its niche

[Home] [Info] [Back] [Next]