FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
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
    NetSeminar
    Reduce Costs, Risks and Resource Constraints with Web Application Security OnDemand
    Not surprisingly, Web application security & compliance continues to be a top priority for companies who rely on their Web site to transact business. But in these challenging economic times, managing costs while reducing risk becomes an added challenge. Join us for this 1-hour webcast and let us share with you the importance of Web application security and our Security as a Service. Date: Tuesday May 26, 2009 Time: 9 am PT/12 pm ET
    Modernize your Development by Moving Build and Code Quality Upstream
    Moderated by Jon Erickson, Editor-in-Chief of Dr. Dobb's, this interactive panel discussion brings industry experts Anders Wallgren, CTO of Electric Cloud and Gwyn Fisher, CTO of Klocwork together for a candid discussion of the cost savings, productivity and quality benefits that can be achieved by stabilizing builds and code quality as early in the development cycle as possible.

    The reality of today's development environment - geographically distributed teams, the use of Agile development practices, increasing application complexity, etc. - is straining the viability of the traditional coding, build and release process. To stay ahead of the curve, development teams are modernizing their approach to dealing with these issues, and as a result are achieving new levels of development productivity. Register for the webcast.
    Date: Wednesday, July 15, 2009
    Time: 11 am PT/2 pm ET
                                   
    CONTEST

    Challenge Winners Announced
    The results are in for Dr. Dobb's Challenge Deuce, and the winners are some of the most innovative Silverlight games out there. Play the winning games.
    INFO-LINK

    Resource Links:




    Techweb
    Informationweek Business Technology Network
    InformationweekInformationweek 500Informationweek 500 ConferenceInformationweek AnalyticsInformationweek Events
    Informationweek MagazineGlobal CIOIWK Government ITbMightyByte and SwitchDark Reading
    Digital LibraryIntelligent EnterpriseInternet EvolutionNetwork ComputingPlug Into The CloudDr. DobbsContentinople
    space
    TechWeb Events Network
    InteropVoiceConWeb 2.0 ExpoWeb 2.0 SummitEnterprise 2.0Mobile Business ExpoNoJitter
    Black HatGTECEnergy CampCloud ConnectGov 2.0 ExpoGov 2.0 Summit
    space
    Light Reading Communications Network
    Light ReadingLight Reading AsiaUnstrungCable Digital NewsInternet EvolutionPyramid Research
    Heavy ReadingLight Reading LiveLight Reading InsiderEthrnet ExpoTelco TVTower Technology Summit
    space
    Financial Technology Network
    Advanced TradingBank Systems and TechnologyInsurance and TechnologyWall Street and TechnologyAccelerating WallstreetBST SummitBuyside Trading SummitIT Summit
    space
    Microsoft Technology Network
    MSDNTechNetTotal IT ProTotal Dev ProNET Total Dev Pro CommunitySQL Total Dev Pro Community
    space