CLIM mail archive

[Prev][Next][Index][Thread]

presentation actions



    Date: Thu, 7 Feb 1991 12:03 EST
    From: kanderso@dino.bbn.com

    We were suprised to find that CLIM 0.9 did not have
    define-presentation-action, so Jeff Morrill wrote one:

If you think you want presentation actions, you are probably wrong.  They are
used for one thing only: performing some sort of action inside of the context of
the input editor.  The only sorts of things that are appropriate to do inside
the input editor are (1) displaying menus, (2) displaying additional information
that will be helpful in constructing commands, and (3) simple reformatting of
displayed data (for example, the expansion of ellipses in a list of
possibilities).  Any use of a presentation action to do something application
specific is incorrect, and should be recast as an application command plus an
ordinary translator.

I just surveyed all of Genera and all of our layered products, and looked at
565 translators.  Of these, 165 were actions.  When I looked at that list, I
found that Symbolics hackers are as guilty as anyone in misusing them.  Of
these 165 actions, only about 30 are legitimately actions.  If you plan to
write actions that do fundamentally different sorts of things than these,
then you are probably misusing them.  Here is the list:

Menus:
 MENU and BLANK-AREA-MENU -- the Mouse-Right menu
 WINDOW-OPERATION-MENU and WINDOW-OPERATION-MENU-BLANK-AREA
 SYSTEM-MENU and SYSTEM-MENU-BLANK-AREA  -- the shift-Mouse-Right menu
 MARKING-AND-YANKING-MENU and MARKING-AND-YANKING-MENU-BLANK-AREA -- control-Mouse-Right
 PRESENTATION-DEBUGGING-MENU -- super-Mouse-Right
 
Displaying additional information:
 EXPAND-ELLIPSIS and ELLIPSIS-MENU -- for expanding ellipses in completion lists

 COM-SHOW-DOCUMENTATION-FOR-COMMAND-NAME-DURING-HELP -- displays documentation
 about a command while you are typing the command in
 
 EDIT-VIEWSPECS and REPRESENT-DIFFERENTLY -- change just the visual appearance
 of something, but not its semantics, during command input. 
 
 DISPLAY-REST-OF-HISTORY, EDITOR-YANK, and DISPLAY-REST-OF-CHANGE-HISTORY
 
Application independent tools for building up input sentences:
 YANK-WORD, MARK-WORD, YANK-MARKED-TEXT, YANK-FROM-KILL-RING, SAVE-MARKED-TEXT,
 UNMARK-MARKED-TEXT, CLEAR-MARKED-TEXT, CLICK-AND-HOLD-MARK-REGION,
 CLICK-AND-HOLD-MARK-REGION-MENU, and EXTEND-MARKED-TEXT are actions because
 they need to operate in any context and are used for building up command
 lines, rather than for asking an application to do something.
 
 REGION-TO-SEQUENCE cannot be done as a translator for reasons I cannot
 articulate very well

Window management:
 SELECT-WINDOW -- so that mousing another window selects it
 
Executive summary: don't use actions.  Use translators.  

    (defmacro define-action
	      (name
	       (from-type to-type &key command-table gesture tester documentation (menu t))
	       arglist
	       &body body)
      ...)

0,,

Follow-Ups:

Main Index | Thread Index