2012-11-11

API-GUI equivalence

8.7: adda/api-gui equivalence:
intro:
. every aspect of a subprogram's gui
should be mapping to some feature of
the subprogram's interface (API);
so how is the API specifying
an array of menus with submenus?
sometimes there is menu-izing naturally formed by
an app inheriting from a service type,
like the file menu is,
for apps that use the file system .
. a datatype's operations are going under the Edit.menu;
because, that's the general term for the current datatype .
. a View.menu would belong to the human's agent
that was providing various ways to
format the display of data; [11.11:
but, a subprogram's API might have multiple views too .]

mac's menu organization:
. the mac's Apple menu is generically known as the System.menu;
-- microsoft refers to it as the Start.menu .
. the mac started in the age of small screens,
so it made sense to have just one menu bar for
both the system and the current app .
. in the 1980's Apple's System.menu let you
choose another app, and learn about the current app
(you'd think quit-app would be in System.menu too,
but that's in the File.menu .
. now that mac is multi-app and multi-window,
the standard menus are:

# [icon of your system].menu:
( about this mac, update, pref's;
 dock, location, recent items;
 force quit, sleep, restart, shutdown, logout
)
# [name of your app].menu:
( about this app, pref's, update;
 sevices/...;
 hide this app, hide others, show all;
 quit
)
# file.menu:
( new, open, save, close
)
# edit.menu:
( undo, redo;
  cut, copy, paste, delete, select all;
  special char's
)
# view.menu:
(app-specific viewing options
)
#, #, # (optional app-specific menus
)
# window.menu:
( minimize, zoom, cycle through windows
, bring all to front
, ( list of current windows to cycle through
-- front is checked)
)
# help.menu:
( search box;
  app-specific items
).
imported modules as menus:
. besides the ways mentioned,
users build apps the same way developers do:
you might start with a basic text type,
then add library modules, each of which
then gets represented by its own menu . [8.21:
for instance, to make the typical document,
you'd import list, text, image;
and then you could build trees having nodes of
text and image .]

editing menus:
. the users can edit the menu's;
so, there must be a dev's equivalent:
the user is actually creating a new app
represented by a hierarchical pkg
that is repackaging the old app .
. the menu-editing operation is offered by the
system menu .

editing menus/it will work:
. having trouble with seeming to need an
app restart just to edit a menu ?
no trouble at all if your restore.tech is there:
when the user hits [save menu edit],
then you save the {app state, new menu},
and restart the window
-- it looks like just a wink: no big surprises .