XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Plugin/Script (Python) Development

Plugin/Script (Python) Development Developers forum for XBMC Python Plugins/Scripts. Scripters/coders only!
Not for posting feature requests, bugs, or end-user support requests!

Reply
 
Thread Tools Search this Thread Display Modes
Old 2004-05-06, 18:12   #1
G_A_V
Junior Member
 
Join Date: May 2004
Posts: 3
G_A_V is on a distinguished road
Default

i have a large bulk of text in a string, that i would like to display to the user in either a dialog or a text box, and the text seems to run off the side of the control and off the side of the screen, instead of sticking to the paramaters of the control. is it possible to get text within the control to stick to the controls paramaters ? or how could i edit my text so that every n'th letter has a new line, with out putting new lines in the middle of a word
G_A_V is offline   Reply With Quote
Old 2004-05-07, 09:14   #2
madtw
Senior Member
 
Join Date: Mar 2004
Posts: 174
madtw is on a distinguished road
Default

i had to write the logic to split up a long string of text into multiple lines based on the controls height and width and the variable width of each character. i ended up building a lookup table for font13, font14, and font16 for the character widths. the code is in the xbmc mythtv project which is still being worked on.

the problem with doing it this way is that a skin might use other fonts and then all bets are off. it would be nice if the font character widths were exposed to python through some api in the interpreter.
madtw is offline   Reply With Quote
Old 2004-05-07, 12:21   #3
alx5962
Senior Member
 
Join Date: Jan 2004
Posts: 174
alx5962 is on a distinguished road
Default

there's a python lib called textwrap that can split strings using a defined number of characters.
i used it in my gueux infos script, so check it if you need an example on how to use it.
alx5962 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overlapping first line of text in text boxes Talus XBMC for Xbox Specific Support 2 2006-05-01 02:14
Disable text for Hearing Impaired in text-based subtitles Bad_Karma XBMC Feature Suggestions 2 2006-04-26 15:54
How To make dialog pop-up with controls? Livin Plugin/Script (Python) Development 4 2006-03-30 12:30
No Text zordon XBMC for Xbox Specific Support 3 2003-10-18 17:11
CD-Text Mog XBMC Feature Suggestions 0 1970-01-01 02:00


All times are GMT +2. The time now is 02:31.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project