![]() |
|
|||||||
| 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! |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2004
Posts: 3
![]() |
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
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Mar 2004
Posts: 174
![]() |
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. |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2004
Posts: 174
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |