Metamouse is a device enabling the user of a drawing program to specify graphical procedures by supplying example execution traces. The user manipulates objects directly on the screen, creating graphical tools where necessary to help make constraints explicit; the system records the sequence of actions and induces a procedure. Generalization is used both to identify the key features of individual program steps, disregarding coincidental events; and to connect the steps into a program graph, creating loops and conditional branches as appropriate. Metamouse operates within a 2D click-and-drag drafting package, and incorporates a strong model of the relative imporlance of different types of graphical constraint. Close attention is paid to user interface aspects, and Metamouse helps the user by predicting and performing actions, thus reducing the tedium of repetitive graphical editing tasks.