Site Archive (Complete)
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
May 07, 2007
Graphic Objects

(Page 1 of 5)
Paul Graham
A graphic interface bypasses the verbal and appeals directly to the visual
Paul Graham is an essayist, programmer, and programming language designer. He can be contacted at www.paulgraham.com/. This classic article first appeared in AI Expert, October 1988.


A user interface is an unusual sort of program because its success depends on emotional appeal. Emotional appeal doesn't ordinarily enter into our judgments of software. We judge a compiler according to more objective considerations, such as its speed and robustness and the speed and robustness of the code it generates. With interfaces, the rules are different.

The user interface is often the least sophisticated element of a program but the one users most care about. For the programmer, this means a relatively small amount of effort can make a program more appealing.

The biggest payoff, as software developers are discovering, is in graphics. A graphic interface by-passes the verbal and appeals directly to the visual. And anyone who has seen a video game knows how much more quickly visual information is assimilated. Who could play a real-time video game in which the state of the game was displayed as a screen of text?

This article discusses how to write graphic interfaces for LISP programs. It includes most of the code necessary to attach graphic objects -- dynamically updated graphic representations -- to LISP data structures. The code can be used to make a wide variety of programs more appealing to the front end of nearly any LISP program in a matter of hours.

This code runs under Common LISP with a very simple window system. If your LISP doesn't support windows, the code will work if you simply eliminate all references to them. It could easily be adapted to run under some other other lexically scoped LISP (such as Scheme), but it depends too heavily on lexical scoping to run under dynamically scoped dialects.

The Aim

This article will discuss graphic interfaces with an object-oriented flavor. To say that the things we're going to make will be objects is to say that:

  • Each will be a discrete collection of LISP functions (or "methods") that entirely defines its behavior.
  • Each will be an instantiation of some archetypical object.
  • Each will act of its own accord; after we've defined an object, we won't have to think about it again; each object will update itself and, if necessary, any other objects, dynamically.

A concrete example will make all this clearer. Using the code given here, we will be able to define a type of graphic object called a "dial". We will then be able to make instances of dials as we need them, attaching them to LISP objects simply by saying attach, dial, and where we want the dial" attached: Once we have attached a dial to something, the dial will henceforth display its value. As the value stored in the LISP object changes, the needle of the dial will move automatically.

1 Introduction | 2 Tiny Database Program | 3 Demons | 4 Simple Graphic Objects | 5 Fancier Graphic Objects Next Page
TOP 5 ARTICLES
No Top Articles.
DR. DOBB'S CAREER CENTER
Ready to take that job and shove it? open | close
Search jobs on Dr. Dobb's TechCareers
Function:

Keyword(s):

State:  
  • Post Your Resume
  • Employers Area
  • News & Features
  • Blogs & Forums
  • Career Resources

    Browse By:
    Location | Employer | City
  • Most Recent Posts:
    MEDIA CENTER  more
    Audio
    2008 International Mathematica Conference
    Dr. Dobb's interviews Wolfram Research's Theo Gray, co-founder and Director of User Interfaces, and Roger Germundsson, Director of Research and Development, about the upcoming 2008 International Mathematica Conference.
    NetSeminar
    Extending Enterprise Value with Web 2.0
    In this webcast we will talk about how to simply build and quickly remix Web 2.0 applications and the role of the IT department and how they support mashups. We will discuss how IBM can help IT teams adapt existing enterprise systems as well as develop unique ones that can support end user driven mashups in a reliable, scalable and secure way. We will highlight a simple scenario adapting an enterprise information source for mashups and how to test it. We will also cover how IBM can help you build agile, fast and simple web applications based on dynamic scripting languages that dramatically reduces development time. Wednesday, September 24, 2008 - 12pm PT / 3pm ET
    The Great Debate: PostgreSQL vs. MySQL
    Common industry perceptions of MySQL and PostgreSQL aren't as true with the current generation of releases as they used to be. DBAs, developers, and IT managers and decision-makers will benefit from this presentation and live Q&A about the pros and cons of using PostgreSQL or MySQL, which will include a discussion about the ongoing trend towards using open source in the enterprise. Tuesday, October 7, 2008 - 9:00 AM PT / 12:00 PM ET
                                   
    EVENTS
    Software Development Best Practices 2008
    October 27-30, 2008
    Boston, MA
    Join us for Software Development Best Practices 2008, Dr. Dobb's premier east coast event, featuring world-class training on the entire software development lifecycle. Register today for a conference pass or a FREE Expo Pass!

    Nominations for the Jolt Awards - the “Oscars” of the software development industry - are now open. Submit your Jolt-worthy products, books and technologies by October 24 to save 20%.
    INFO-LINK

    Resource Links:




    Related Sites: DotNetJunkies, SD Expo, SqlJunkies