Next Previous Up Top Contents Index

3 Improving The Design

3.3 Adding a default callback

Nothing is more frustrating than designing a user interface that does not respond to user input. Although, in the early stages at least, the user interface does nothing particularly useful, you can at least define a "not yet implemented" message that can be used until you define real behavior for the application.

The definition of the function that gives you this default behavior is as follows:

define function not-yet-implemented (gadget :: <gadget>) => ()
  notify-user("Not yet implemented!", owner: sheet-frame(gadget))
end function not-yet-implemented;

Add this function to frame.dylan.

You can call this function from any gadget in the task list manager by defining it as the activate callback for each gadget. There are several types of callback, and this is the type that is used most in the task list manager. You can define the activate callback for any gadget using the activate-callback: init-keyword. More information about callbacks is given in Chapter 5, "Adding Callbacks to the Application", in which some real callbacks are defined, to make the task list manager do something more substantial.


Building Applications Using DUIM - 26 May 1999

Next Previous Up Top Contents Index