[HELP] How to define a label with multiwrap and scroll (down to up)
#1
Hi, I need a control for text that can represent a big text in various lines and, also, that can be sroll the text for down tu up if the size of the text is larger than its capacity.

The idea is define a label control with the tags wrapmultiline and scroll in True but, wrapmultiline seems to be incompatible with the scroll tags.
¿How do you define a control text capable of multiline and capable of scrolling automaticaly if the size of its text is larger that the its size?

Thanks a lot.
Reply
#2
Maybe something like this:
https://github.com/paddycarey/script.art.../viewer.py

We save text to a textfile and then use the skin changelog/textviewer to show the content of the tekst file.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
Thanks by i need something more simple for use as a label.
There is not support in skin or xbmc api for this?
Reply
#4
i want to do this as well, is there any way to do it with python?
Reply
#5
Have a look to my "Mail" program add-on, its in the official repository.

You can also look at the source here: https://github.com/dersphere/plugin.prog...on.py#L210

Here is example code (without the need for using a file):
PHP Code:
def email_show(mailboxemail_id):
    
client _login()
    if 
not client:
        return
    
xbmc.executebuiltin('ActivateWindow(%d)' 10147)
    
window xbmcgui.Window(10147)
    
email client.get_email(email_idmailbox)
    
header '%s - %s' % (email['from'], email['subject'])
    
text '\r\n'.join((
        
'=====================================================',
        
'[B]From:[/B] %s' email['from'],
        
'[B]To:[/B] %s' email['to'],
        
'[B]Date:[/B] %s' email['date'],
        
'[B]Subject:[/B] %s' email['subject'],
        
'=====================================================',
        
email['body_text'],
    ))
    
window.getControl(1).setLabel(header)
    
window.getControl(5).setText(text
My GitHub. My Add-ons:
Image
Reply
#6
well thats not really what im looking for...

Im looking at a long string which i grab from a webpage via scrapping and i want to pass that to the label.

The label of course will not display it correctly without adding \n every few characters..

I have to do a very hacky code to calculate the pixels, the font size and then add new lines to make it look as wrapmultiline..
Reply
#7
(2014-01-17, 17:54)adrianc1982 Wrote: well thats not really what im looking for...

Im looking at a long string which i grab from a webpage via scrapping and i want to pass that to the label.

The label of course will not display it correctly without adding \n every few characters..

I have to do a very hacky code to calculate the pixels, the font size and then add new lines to make it look as wrapmultiline..

Even it this isn't the way you want to go, this window (10147 = DialogTextViewer.xml) is capable of doing what you want so maybe you can have a look how its done there: https://github.com/xbmc/xbmc/blob/master...er.xml#L47

From a very quick look it uses a textbox-control and a scrollbar-control to achieve this.
My GitHub. My Add-ons:
Image
Reply
#8
Textbox works if you can load everything at once and you don't need to scroll individual sentences. If you need more control, cut the sentences up an put them in list items for a list control. Examples like lyrics addon or IrcChat.
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply

Logout Mark Read Team Forum Stats Members Help
[HELP] How to define a label with multiwrap and scroll (down to up)0