Text in imageSource
Sarah Reichelt
sarah.reichelt at gmail.com
Wed Jan 25 19:57:15 EST 2006
Hi All,
I have a list field which I want to use to show ratings in a way
similar to how iTunes does it i.e. a column with stars or dashes to
indicate the current rating which can be clicked to change them.
I have done it OK and it works fine except for sorting. In the initial
setup, I set the htmlText of the field directly and use "img src" to
set the correct icon in place. The line below gives a 1 star rating:
put "<img src=" & quote & "Star.png" & quote & "><img src=" &
quote & "Dash.png" & quote & \
"><img src=" & quote & "Dash.png" & quote & "></p>" into
item 5 of line x of tHTML
When the rating is changed by clicking, I use this:
put pRating & ".." into item 5 of line pLineNum of fld "PictureList"
repeat with x = 1 to 3
if x > pRating then
put "Dash.png" into tImage
else
put "Star.png" into tImage
end if
set the imageSource of char x of item 5 of line pLineNum of
fld "PictureList" to tImage
end repeat
The second method produces a column that can be sorted, but setting
the html directly does not. Checking the htmlText for each method,
they appear to be identical.
It's as if Rev is storing the original character somewhere hidden and
it doesn't appear in the htmlText although it is available to the sort
command.
I've tried setting the "alt" of the img but that doesn't help.
I have to use the direct HTML method for the initial display as
setting the imageSource of each line on the field takes far too long,
but it has to be sortable. Does anyone have any ideas?
TIA,
Sarah
More information about the use-livecode
mailing list