Kodi Community Forum
using multiline label control in a list - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: using multiline label control in a list (/showthread.php?tid=29504)



using multiline label control in a list - i_cohen - 2007-11-04

hey,

i want to include a label control inside a "list control" which will get the ListItem.Label as <info>. the problem is i want it to wrap to a multiline but it doesnt (from what i understand you need to have \n). the info is filled by xbmc for media items. tried using textbox but nothing was shown.

what can i do?

idan


- Martomo - 2007-11-04

Hey i_cohen,

I'll try to post it, but it reacts as a next line tag on the forums too Confused

For example:
PHP Code:
    <include name="10090">
        <
label>This will print the first line

This line is printed on line 2
</label>
    </include> 

Hope this helped.


- Martomo - 2007-11-04

Arrgh.. another attempt...
PHP Code:
    <include name="10090">
        <
label>This will print the first line&#10; This line is printed on line 2</label>
    
</include> 

Sorry for the weird PHP color code, it's the only one that seems to work.


- i_cohen - 2007-11-05

yes but this is the whole problem, i'm getting the text from the system (listitem.label) and i cant enter the line breaks in it.


- Martomo - 2007-11-05

i_cohen Wrote:yes but this is the whole problem, i'm getting the text from the system (listitem.label) and i cant enter the line breaks in it.

I see, let's say you have a label with an width of 300px

If you want it in one line, you could use the scroll tag, for example:

Code:
<control type="label">
  .....
    <width>300</width>
    <info>ListItem.Label</info>
    <scroll>true</scroll>
  .....
</control>

If you want the label in mutiple lines you can use wrapmultiline tag, for example:
Code:
<control type="label">
  .....
    <width>300</width>
    <info>ListItem.Label</info>
    <scroll>false</scroll>
    <wrapmultiline>true</wrapmultiline>
  .....
</control>

For more information about labels, check out this article:
http://www.xboxmediacenter.com/wiki/index.php?title=Label_Control

Hope this helped.