|
Class: ActionWaitBox
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--TopView
|
+--StandardSystemView
|
+--ModalBox
|
+--DialogBox
|
+--ActionWaitBox
- Package:
- stx:libwidg3
- Category:
- Views-DialogBoxes
- Version:
- rev:
1.7
date: 2017/03/15 16:23:43
- user: mawalch
- file: ActionWaitBox.st directory: libwidg3
- module: stx stc-classLibrary: libwidg3
- Author:
- Claus Gittinger
ActionWaitBoxes are boxes which block the caller while some action
is performed. For example, when some long time computation is performed,
an instance of myself can be shown on top of the busy view, to
let the user know what is going on.
See examples for a concrete application.
AnimatedLabel
ProgressIndicator
accessing
-
action: aBlock
-
set the block to be performed by myself
realization
-
abortPressed
-
sent by the cancel button; user pressed abort button
- hide myself and evaluate okAction
-
openDoing: aBlock
-
-
realize
-
|box label images|
box := ActionWaitBox new.
box label:'computing ...'.
label := AnimatedLabel new.
images := Array new:12.
1 to:12 do:[:i |
images at:i put:(Image fromFile:'bitmaps/write.' , i printString , '.xbm')
].
label imageSequence:images; frameDelay:0.1.
box addComponent:label.
(box addAbortButton) label:'abort'.
box action:[
1 to:20 do:[:run |
1000 factorial.
run printNL
].
].
box openWithExtent:100@100.
|
|box label images|
box := ActionWaitBox new.
box label:'computing ...'.
label := AnimatedLabel new.
images := Array new:12.
1 to:12 do:[:i |
images at:i put:(Image fromFile:'bitmaps/write.' , i printString , '.xbm')
].
label imageSequence:images; frameDelay:0.1.
box addComponent:label.
(box addAbortButton) label:'abort'.
box openDoing:[
1 to:20 do:[:run |
1000 factorial.
run printNL
].
].
|
|