public
Last active

dsf screen-identifiers

  • Download Gist
gistfile1.cl
Common Lisp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
(block nil
 
;; a very simple example
(setq screens (lambda nil
(block nil
;; start a new screen
(dsf/new-screen 'screen-one 'standard "Screen One")
(dsf/add-action 'goto-two "Go to Screen 2" 'G '(dsf/show-screen 'screen-two))
(dsf/default-action 'goto-two)
;; start another
(dsf/new-screen 'screen-two 'standard "Screen Two")
(dsf/add-action 'goto-one "Go to Screen 1" 'G '(dsf/show-screen 'screen-one))
(dsf/default-action 'goto-one)
 
;; show screen one
(dsf/show-screen 'screen-one)
)
))
 
;; a bit more powerful example, showing the use of screen-identifiers
(setq screens-two (lambda nil
(block nil
;; start a new screen again (this wipes out the old one)
(dsf/new-screen 'screen-one) ; defaults to 'standard screen type
(dsf/name "Screen One")
(dsf/add-action 'goto-two "Go to screen two" 'G '(dsf/show-screen 'screen-two))
(dsf/default-action 'goto-two)
 
;; start another
(dsf/new-screen 'screen-two 'standard "Screen Two")
(dsf/add-action 'goto-one "Go to Screen 1" 'G '(block nil
(dsf/use-screen 'screen-one) ; the next actions we perform will be on screen-one
(dsf/add-action 'new-action "Go to screen three" 'S '(dsf/show-screen 'screen-three))
(dsf/show-screen 'screen-one) ; we could leave out the screen identifier here
))
(dsf/default-action 'goto-one)
 
;; screen three
(dsf/new-screen 'screen-three) ; defaults to 'standard screen type
(dsf/name "Screen Three")
(dsf/add-action 'exit "Exit" 'E '(dsf/exit))
(dsf/default-action 'exit)
 
;; show screen one
(dsf/show-screen 'screen-one)
)
))
)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.