PackageDescription: Attractions-UI


Attractions - UI

Last published: July 8, 2007 by 'michael'

Defines 12 Classes
Extends 15 Classes


A simple UI subsystem for windows and their events, utilising the Attractions framework for the events and simplying the window down to be possessed by an owner so that it does not participate in a UI widget hierarchy but acts more like an operating system handle.

The majority of its behaviour is still inherited. It is a scheduled window to avoid events being backed up and unprocessed and to also inherit the MultiProcUI code in VisualWorks. To create and destroy one, do the following:

| osWindow |
"Make the window"
osWindow := AttractionsUI.Window new.
osWindow owner: self halt. "provide an owner here that responds to the protocol of an @owner as described below"
"Optional: osWindow displayBox: (0@0 extent: 500@500)."
"Optional: osWindow title: 'Hello World'."

"Open the window"
osWindow createSurfaceWithForcedPosition: true.
osWindow scheduleWindow.
osWindow map.

"Close the window"
osWindow close.
osWindow unscheduleWindow

To be an @owner of an AttractionsUI.Window you must implement the following methods:
#emit: anEvent
Handle an event that was raised by the VM, such as #close, #destroy and #expose
#invalidateRectangle: aRectangle repairNow: repairNow
Redraw a section of the window. It's rare that repairNow isn't true, so, do it now.