Hi, everyone!!
I'm trying to put items dynamically on a listbox, but when i wrap some
text in each item of the list, the text inside
the label overflows view's size and doesn't fit on the "readable"
area.
Here i put my code
main.xml:
<view height="450" width="250" onopen="view_onOpen()"
onoptionchanged="onOptionChanged();"
onsize="view_onRestore()">
<div height="300" name="MessageFeed" width="250">
<listbox height="300" name="MessageList" width="250"
background="#FFFFFF"
itemHeight="20" itemOverColor="#DBEEFE" autoscroll="true"
itemSelectedColor="#CBDEEE">
<item height="20">
<label>Loading Messages...
</label>
</item>
</listbox>
</div>
<div height="150" name="SendMessage" width="250" y="300">
<img y="3" src="stock_images\background.png"/>
<button height="22" width="141" x="97" y="114" onclick="sendMessage
()"
downImage="stock_images\button_down.png" image="stock_images
\button_up.png"
overImage="stock_images\button_over.png" caption="Envia un
mensaje"/>
<edit height="84" name="txtMessage" width="190" x="19" y="18"
multiline="true"
/>
</div>
<script src="SimpleXmlParser.js" />
<script src="main.js" />
<script src="core.js" />
</view>
And main.js:
function renderMessages(items){
if(items.length>0){
MessageList.removeAllElements();
}
for(var id in items){
var username = items[id].na;
var content = items[id].co;
var dateString = items[id].da;
var msgLiteral = dateString + ", " + username + " dice: " +
content
var listItem = MessageList.appendElement("<item name=\"msg" +
id +
"\"></item>");
var label = listItem.appendElement("<label height=\"100%\">" +
msgLiteral + "</label>");
label.wordWrap = true;
}
}
Any help will be greatly appreciated, i'm pretty stucked with this.
Thanks!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---