Skip to content

Instantly share code, notes, and snippets.

@alterecco
Created July 26, 2010 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alterecco/490112 to your computer and use it in GitHub Desktop.
Save alterecco/490112 to your computer and use it in GitHub Desktop.
(setq dsf/show-screen (lambda (screen-id pane-id)
(block nil
(dsf/debug 1 "show-screen")
;; 'self eq nil
(if (eq screen-id 'self) (setq screen-id nil))
(if (eq pane-id 'self) (setq pane-id nil))
;; if we were not passed in a context,
;; and we don't have a valid one, error out
(if (not screen-id)
(-dsf/check-context "show-screen")
)
;; always store the current context
(-dsf/store-context)
;; find the screen to show, and load the data into the context.
;; make sure working context is nil, and visible context matches
;; the data in the context
(block (ctx csid)
(if -dsf/working-context
(setq ctx -dsf/working-context)
(if -dsf/visible-context
(setq ctx -dsf/visible-context)
)
)
(if ctx
(block nil
(setq csid (item ctx 0))
(if (not screen-id) (setq screen-id csid))
(if (not pane-id)
(setq pane-id (dsf/select (item ctx 1) 'default))
)
)
)
(if (not (eq screen-id csid))
(setq -dsf/context-data (dsf/get -dsf/screen-store screen-id (list)))
)
(setq -dsf/working-context nil)
(setq -dsf/visible-context (list screen-id pane-id))
)
(scrShowScreen gScreen (dsf/get -dsf/context-data 'screenUNID))
(dsf/debug 1 "exit show-screen")
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment