Paste number 13379: Thanks Marco

Paste number 13379: Thanks Marco
Pasted by: Birdman
When:19 years, 3 months ago
Share:Tweet this! | http://paste.lisp.org/+ABN
Channel:None
Paste contents:
Raw Source | XML | Display As


;;;;Thanks Marco for giving us such a cool system.

;;this snippet of code might not be all that great, 
;;but i really liked having a link to a
;; progn that sets a value and switches a component.

(defmethod render ((navbar navbar))
  "Render a navbar by seeing what components are in the page body
and providing a link to each. Also put a link next to each that will show
the inspector inspecting that component. The inspector will even inspect itself."
  (<:ul
	(dolist* ((label . comp) (ucw::container.contents (page-body navbar)))
	  (<:li
		 ;a link to switch to the component
		(<ucw:a :action (switch-component (page-body navbar) label)
				  (<:as-html label))
		(<:as-is " [")
		;link to inspect the component.
		(<ucw:a :action (progn (setf (ucw::datum (find-component (page-body navbar) 'inspector)) comp)
									  (switch-component (page-body navbar) 'inspector))
				  (<:as-is "#"))
		(<:as-is "]")))))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.