Created
July 26, 2010 02:40
-
-
Save alterecco/490112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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