Kodi Documentation  18.0
Kodi is an open source media player and entertainment hub.
Subclass - ControlTextBox

Used to show a multi-page piece of text. More...

Classes

class  XBMCAddon::xbmcgui::ControlTextBox
 

Functions

 XBMCAddon::xbmcgui::ControlTextBox::setText (...)
 

Function: setText(text)


Set's the text for this textbox. More...

 
 XBMCAddon::xbmcgui::ControlTextBox::getText ()
 

Function: getText()


Returns the text value for this textbox. More...

 
 XBMCAddon::xbmcgui::ControlTextBox::reset ()
 

Function: reset()


Clear's this textbox. More...

 
 XBMCAddon::xbmcgui::ControlTextBox::scroll (...)
 

Function: scroll(id)


Scrolls to the given position. More...

 
 XBMCAddon::xbmcgui::ControlTextBox::autoScroll (...)
 

Function: autoScroll(delay, time, repeat)


Set autoscrolling times. More...

 

Detailed Description

Used to show a multi-page piece of text.

Class: ControlTextBox(x, y, width, height[, font, textColor])

The text box is used for showing a large multipage piece of text in Kodi. You can choose the position, size, and look of the text.

Note
This class include also all calls from Control
Parameters
xinteger - x coordinate of control.
yinteger - y coordinate of control.
widthinteger - width of control.
heightinteger - height of control.
font[opt] string - font used for text. (e.g. 'font13')
textColor[opt] hexstring - color of textbox's text. (e.g. '0xFFFFFFFF')
Note
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
After you create the control, you need to add it to the window with addControl().

Example:

...
# ControlTextBox(x, y, width, height[, font, textColor])
self.textbox = xbmcgui.ControlTextBox(100, 250, 300, 300, textColor='0xFFFFFFFF')
...

Function Documentation

§ autoScroll()

void XBMCAddon::xbmcgui::ControlTextBox::autoScroll (   ...)

Function: autoScroll(delay, time, repeat)


Set autoscrolling times.

Parameters
delayinteger - Scroll delay (in ms)
timeinteger - Scroll time (in ms)
repeatinteger - Repeat time

v15 Python API changes:
New function added.

Example:

...
self.textbox.autoScroll(1, 2, 1)
...

§ getText()

String XBMCAddon::xbmcgui::ControlTextBox::getText ( )

Function: getText()


Returns the text value for this textbox.

Returns
To get text from box

Example:

...
# getText()
text = self.text.getText()
...

§ reset()

void XBMCAddon::xbmcgui::ControlTextBox::reset ( void  )

Function: reset()


Clear's this textbox.


Example:

...
# reset()
self.textbox.reset()
...

§ scroll()

void XBMCAddon::xbmcgui::ControlTextBox::scroll (   ...)

Function: scroll(id)


Scrolls to the given position.

Parameters
idinteger - position to scroll to.

Example:

...
# scroll(position)
self.textbox.scroll(10)
...

§ setText()

void XBMCAddon::xbmcgui::ControlTextBox::setText (   ...)

Function: setText(text)


Set's the text for this textbox.

Parameters
textstring or unicode - text string.

Example:

...
# setText(text)
self.textbox.setText('This is a line of text that can wrap.')
...