[Seaside] Indenting elements in select list

Yar Hwee Boon hboon at motionobj.com
Tue Feb 1 18:06:25 CET 2005


On 01-Feb-05, at PM 10:01, David Röthlisberger wrote:

> I would like to fill a select list with elements, and some elements 
> should
> be indented.
>
> E.g.:
> element1
>   element2
>     element3

This might be overkill, but one way you can do this is to define a 
IndentedString class such that you can do

list := (Array
				with: (IndentedString new string: 'abc';
						 level: 0)
				with: (IndentedString new string: 'def';
						 level: 2)
				with: (IndentedString new string: 'ghi';
						 level: 4)).
html
		selectFromList: list
		selected: list first
		callback: [:v | self halt]
		labels: [:v | v].

and then override #renderOn

IndentedString>>renderOn: html
	level
		timesRepeat: [html html: ' '].
	html text: string

--
HweeBoon
MotionObj
(65) 6764-9774
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 825 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20050202/46ef6605/attachment.bin


More information about the Seaside mailing list