Slick Forums

Discuss the Slick 2D Library
It is currently Fri May 24, 2013 6:23 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri May 28, 2010 4:18 am 
Offline

Joined: Mon May 03, 2010 6:58 pm
Posts: 9
I'm looking to put indentation into a HTMLTextAreaModel in my gui but anytime I use   the model inserts "null" instead of a space.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 28, 2010 8:28 am 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1173
It is fixed in the latest TWL version.

But why do you use &nbsp; for indentation - what about using a <div> with margin-left ?

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 28, 2010 12:43 pm 
Offline

Joined: Mon May 03, 2010 6:58 pm
Posts: 9
I don't actually know html very well, this is my first experience, so there might be a better way, but in my case, among other things, I'm trying to print python code, and div margin-left doesn't seem to be quite what I'm looking for. This is the code that translates strings into my text field.

Code:
input = input.replace("<", "&lt;").replace(">", "&gt;").replace("\n", "<br/>").replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;").replace(" ", "&nbsp;");

        String colorString = "";
        colorString += String.format("%02x", getColor().getRed());
        colorString += String.format("%02x", getColor().getGreen());
        colorString += String.format("%02x", getColor().getBlue());
        String finalString = "<div style=\"font:" + colorString + "\">" + input + "</div><br/>";


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 28, 2010 12:49 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1173
well - how about using style="white-space: pre" or use the SimpleTextAreaModel class?

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group