Kodi Community Forum

Full Version: ControlTextBox only uses 50% of width in HD
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

I'm not sure if this is related to XBMC or if its a Python bug. Anyway there is a small but anoying problem how the text is aligned in ControlTextBoxes in 720p and 1080i resolutions. Only 50% of the width is used and the right hand part of the control is left blank. It looks as if there is an innerwidth parameter not accessable from Python causing linebreaks at the wrong position. I can double the textbox width to get a nicer look but this pushes the scroll arrows outside the screen.
I have not noticed this behaviour in other resolutions.

Any ideas?

Thanks,

MrZ
This seems strange to me that it doesn't do it in SD resolutions.

There is obviously no hardcoded value, as it is using just half the width (and you can just double the width).

Nothing from the code side of thing looks to be affecting this - I suggest you upload an example script so that others with 720p may reproduce.

Cheers,
Jonathan
It works fine for me in 720p.

There was an issue with scrolling in controls not scaling in higher resolutions, but that was fixed.

Are you using setcoordinateresolution()?

As jmarshall said an example would help.
Hi Nuka and Jonathan!

Yes I'm using setcoordinateresolution().
My DagensTV script may serve as example, look at self.pgmInfo appearing under program listings.

http://www.xbmcscripts.com/modules/mod_d...&Itemid=36

Thanks for your effort,

MrZ
your script does look like it's not workin. try the following as a simple test to be sure, the following works for me. Maybe how your parsing the webpage not removing /r/n or something?

edit: sweet init now worksSmile

Code:
import xbmc, xbmcgui
class win(xbmcgui.Window):
def __init__(self):
  self.setCoordinateResolution(6)
  self.lbl = xbmcgui.ControlTextBox(50, 50, 600, 500,)

  self.addControl(self.lbl)
  self.lbl.setText("kjklj f gsafljgsfljghsfkj lfwfkhw kfh lkfhk wkfh wkfh wlkhfkw hflkw hfkwhfkwh fkhwkfhw khfwk hwkfh wkhfwkhjf wkhjfk wjhfkwhjfkwjhfkwjhfkwjh f kwjhf lkwhfkwjhfkwhfkwjhfkwjhfwf hwfhwkhflwkhfl iwfi wiufh wiufh wilufh wliihfl hflk hf whfliuwhfiuhwfliuhwlifhwlifuhwlifuh wlfh swkfh lwiihfliwisuhfliuhfluiwfhlsiufhluifhlsiuhfliwuhfliwuhflwiuhflishflsiuhflwihuf")
d = win()
d.doModal()
del d
Yes that one works. But

In my script I'm updating the control from a timer thread. This is when it goes wrong. I tried with your text and outside the thread alignment is OK. Setting the same text from within the thread it goes wrong. I have tried using a global variable as object pointer to check if there is some pointer error because of the thread. That did not help either.

MrZ
Problem solved in XBMC v2.0

MrZ