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 menuGenerating the text style menu structure is quick and straightforward using ResourceMaster. Unless otherwise instructed use the left mouse button. After launching ResourceMaster:
- Use File>New to create a resource file.
- Use Create>Menu to create the menu skeleton.
- Name the menu skeleton (MAINMENU works well).
- Double-click Program then name the title (MM_DESK) and edit the text (Flowchart replaces Program).
- Click Flowchart to get drop-down menu.
- Double-click Your Message then name the entry (MD_ABOUT) and edit the text (About Flowchart...).
- Double-click File then name the title (MM_FILE).
- Click File to get the drop-down menu.
- Right-click to get the menu toolbox.
- Drag an Entry to the drop-down menu, position it completely inside the menu on top of the existing Quit, and release.
- Repeat as necessary, adding Entry and ----- to create the complete File menu.
- Double-click each Entry then name each entry (MF_nnnnn) and edit the text.
- Repeat until all entries are complete.
Thinking Out Loud
Some new GEM commands related to the menu bar should offer greater creativity in screen usage,
for example:
- menu_orient( edge ) would put the menu bar along the TOP, LEFT, RIGHT, or BOTTOM edge of the screen. Naturally, the MN_DEFAULT_EDGE would be the TOP. A value of INQUIRE (-1) would return the current edge.
- menu_height( pixels ) would allow for larger menu bars than the MN_DEFAULT_HEIGHT, currently 1 character plus two pixels when the menu bar is along the TOP or BOTTOM edge. INQUIRE would return the current height in pixels.
- menu_width( pixels ) would allow for larger menu bars than the MN_DEFAULT_WIDTH (equivalent to 12 characters, maybe) when the menu bar is along the LEFT or RIGHT edge. INQUIRE would return the current width in pixels.
- menu_depth( count ) would allow for nested objects like radio buttons if set to MAX_DEPTH (8) instead of MN_DEFAULT_DEPTH. INQUIRE would return the current depth count.
- menu_just( direction ) would allow menu bar entries to be LEFT, RIGHT, or CENTER justified. Although this call is primarily intended for menus along the LEFT or RIGHT screen edge, it might be handy for TOP and BOTTOM orientations as well. INQUIRE would return the existing setting.
- menu_font_style( selection ) would allow additional customisation so the user wouldn't be stuck with the MN_DEFAULT_FONT_STYLE. INQUIRE would return the existing setting.
- menu_font_size( size_in_points ) would be an ideal companion call to menu_font_style.
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
![]() |
![]() |
![]() |
![]() |