ControlTextBox boundaries

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
yarin.levy2 Offline
Junior Member
Posts: 25
Joined: Apr 2016
Reputation: 0
Post: #1
Hello,

Is there a way or a trick to see visually the boundaries of a ControlTextBox that I created using xbmcgui module?

I think textbox would look much better with boundaries in my addon.


Thanks
(This post was last modified: 2017-04-20 17:46 by yarin.levy2.)
find quote
Roman_V_M Online
Team-Kodi Member
Posts: 1,115
Joined: Jun 2011
Reputation: 54
Location: Kyiv, Ukraine
Post: #2
IIRC ControlTextBox doesn't have any textures. But since xbmcgui.Controls can overlap, you can add some background with ControlImage. Also, Dialog().textviewer was added in Krypton.

Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
find quote
yarin.levy2 Offline
Junior Member
Posts: 25
Joined: Apr 2016
Reputation: 0
Post: #3
(2017-04-20 19:50)Roman_V_M Wrote:  IIRC ControlTextBox doesn't have any textures. But since xbmcgui.Controls can overlap, you can add some background with ControlImage. Also, Dialog().textviewer was added in Krypton.

Thank you. That was helpful.

I'm now facing another question about scrolling the TextBox.

Can you enlighten my eyes about how do I scroll the ControlTextBox?

The TextBox contains text that accumulates, I want to scroll down so I can always see the bottom of the TextBox in order to see the latest things.

I tried this and it doesn't seem to do something:

self.textbox = xbmcgui.ControlTextBox(0, 0, 1200, 200, textColor='0xFFFFFFFF')
self.addControl(self.textbox)
self.textbox.setText('long text for example...\n\n\n\n\n...')
self.textbox.scroll(150) # different numbers that I tried here didn't change anything


Thanks.
find quote
Lunatixz Offline
Skilled Python Coder
Posts: 4,891
Joined: May 2011
Reputation: 142
Location: NYC
Post: #4
(2017-04-26 20:49)yarin.levy2 Wrote:  
(2017-04-20 19:50)Roman_V_M Wrote:  IIRC ControlTextBox doesn't have any textures. But since xbmcgui.Controls can overlap, you can add some background with ControlImage. Also, Dialog().textviewer was added in Krypton.

Thank you. That was helpful.

I'm now facing another question about scrolling the TextBox.

Can you enlighten my eyes about how do I scroll the ControlTextBox?

The TextBox contains text that accumulates, I want to scroll down so I can always see the bottom of the TextBox in order to see the latest things.

I tried this and it doesn't seem to do something:

self.textbox = xbmcgui.ControlTextBox(0, 0, 1200, 200, textColor='0xFFFFFFFF')
self.addControl(self.textbox)
self.textbox.setText('long text for example...\n\n\n\n\n...')
self.textbox.scroll(150) # different numbers that I tried here didn't change anything


Thanks.

Set
Code:
autoScroll(delay, time, repeat)
https://codedocs.xyz/xbmc/xbmc/group__py...7d2c3c757b
(This post was last modified: 2017-04-26 21:20 by Lunatixz.)
find quote
yarin.levy2 Offline
Junior Member
Posts: 25
Joined: Apr 2016
Reputation: 0
Post: #5
(2017-04-26 21:19)Lunatixz Wrote:  Set
Code:
autoScroll(delay, time, repeat)
https://codedocs.xyz/xbmc/xbmc/group__py...7d2c3c757b


I know autoScroll and it works great.
I will try to use it in order to see the latest text... maybe minimum Scroll time and long Scroll delay.

Thank you
(This post was last modified: 2017-04-26 23:50 by yarin.levy2.)
find quote