Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DSL for layout --> CSS

4 views
Skip to first unread message

Lars Rune Nøstdal

unread,
Nov 30, 2008, 7:23:11 AM11/30/08
to
hey,
this is cool .. one go from something like:

(let ((layout-data '((a a b c)
(a a e e)
(g h i i))))
..)


..to this:
http://nostdal.org/lnostdal/static/div/symbolicweb-local.org-layout-first-test.html

..try resizing the browser window .. further, i'm thinking:

(with-layout (:names ((M main-menu)
(C context-menu)
(I info-box)
(S status-bar)
(. main-content)))

((M M M M M M M M M M)
(M M M M M M M M M M)
(C C . . . . . . . .)
(C C . . . . . . . .)
(C C . . . . . . . .)
(C C . . . . . . . .)
(C C . . . . . . . .)
(I I . . . . . . . .)
(I I . . . . . . . .)
(S S S S S S S S S S))

(setf (background-color-of main-menu) "green")
..add menu items, setup callbacks etc.))

..or something like that .. CSS has a layer thingy also; z-index .. i
can have many of these on the same "page" at the same time (dialogs;
hidden message/alert layer?)

it's still early and not finished or integrated into SW yet, but here is
the source code:

http://common-lisp.net/~lnostdal/programming/lisp/symbolicweb/src/layout.lisp


..maybe there are better or other ways to do this? .. i needed something
fast(!) when it comes to changing layout; ascii wysiwyg is pretty fast
or direct :)

Kenny

unread,
Nov 30, 2008, 8:02:47 AM11/30/08
to

Sweet!

>
> (setf (background-color-of main-menu) "green")
> ..add menu items, setup callbacks etc.))

SETF? Did I hear the word SETF?! Keep it declarative and you'll have a
smooth transition to Cells. In fact, you could use Cells and just
leverage the observer mechanism, which would see a slot take on it
initial value as well as change later and do the SETF for you.

Propagating to the client left as an exercise. :)

hth,kzo

Alex Mizrahi

unread,
Nov 30, 2008, 9:17:39 AM11/30/08
to
LRN> this is cool .. one go from something like:

LRN> (let ((layout-data '((a a b c)
LRN> (a a e e)
LRN> (g h i i))))
LRN> ..)

this reminds me analog literal stuff:

http://www.reddit.com/r/programming/comments/75bxi/multidimensional_analog_literals_the_reason_why_c/c05pu95

(inspired by C++ implementation
http://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml)

i thought stuff like that could be actually useful for making layout
definitions
easier, and it seems it is.

LRN> ..try resizing the browser window .. further, i'm thinking:

LRN> (with-layout (:names ((M main-menu)
LRN> (C context-menu)
LRN> (I info-box)
LRN> (S status-bar)
LRN> (. main-content)))

LRN> ((M M M M M M M M M M)
LRN> (M M M M M M M M M M)
LRN> (C C . . . . . . . .)
LRN> (C C . . . . . . . .)
LRN> (C C . . . . . . . .)
LRN> (C C . . . . . . . .)
LRN> (C C . . . . . . . .)
LRN> (I I . . . . . . . .)
LRN> (I I . . . . . . . .)
LRN> (S S S S S S S S S S))

yep, nice idea


0 new messages