2014-12-20, 02:44
Hi guys,
I need some basic help with my code. I have got no problem with my code, but I have a bit of trouble with creating the width size that I actually want. I'm created the size to controls the width for the xbmcgui.controlbutton.
When I use this:
The result will show like this:
So when I try this:
It will show the result without the .06 or whatever it is when I pressed on the right arrow button:
Can you please help me with how I can get the full width size that would show to something like `181.09`, `181.10`, `181.12` or whatever it is to allow me to control the size with the right hours for the tv program buttons?
I really need it because I want the buttons size to be different from the other buttons if it comes with the same size. I'm controlling the buttons to resize it with each different size with the right hours of the tv program buttons with the right time and the right size, otherwise it will get mess it up if the buttons comes with all the same size.
I need some basic help with my code. I have got no problem with my code, but I have a bit of trouble with creating the width size that I actually want. I'm created the size to controls the width for the xbmcgui.controlbutton.
When I use this:
Code:
#create width size for per program button
if position_start == 375:
if program_length >= 10 and program_length <= 60:
program_width = 342.06
elif program_length >= 60 and program_length <= 90:
program_width = 691.09
elif program_length >= 90 and program_length <= 105:
program_width = 879.10
elif program_length >= 105 and program_length <= 120:
program_width = 879.12
if position_start == 724:
if program_length >= 10 and program_length <= 60:
program_width = 342.06
elif program_length >= 60 and program_length <= 90:
program_width = 181.09
elif program_length >= 90 and program_length <= 105:
program_width = 181.10
elif program_length >= 105 and program_length <= 120:
program_width = 181.12
program_controls = xbmcgui.ControlButton(
int(position_start),
int(position_top),
int(program_width),
int(program_height),
program_title,
focusTexture = path + self.button_focus,
noFocusTexture = path + self.button_nofocus,
textColor ='0xFFFFFFFF',
focusedColor ='0xFF000000'
)
The result will show like this:
Code:
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 879.15
00:21:38 T:5900 NOTICE: 879.18
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:38 T:5900 NOTICE: 342.06
00:21:39 T:5900 NOTICE: 342.06
00:21:39 T:5900 NOTICE: 342.06
00:21:39 T:5900 NOTICE: 879.12
00:21:39 T:5900 NOTICE: 342.06
So when I try this:
Code:
def GoRight(self):
# change program controls to display the proper junks
if self.channels_Index != len(self.program_buttons) - 1:
CurrentRow = self.program_buttons[self.programs_Index].getX()
width = self.program_buttons[self.programs_Index].getWidth()
print width
It will show the result without the .06 or whatever it is when I pressed on the right arrow button:
Code:
00:23:29 T:3096 NOTICE: 342
Can you please help me with how I can get the full width size that would show to something like `181.09`, `181.10`, `181.12` or whatever it is to allow me to control the size with the right hours for the tv program buttons?
I really need it because I want the buttons size to be different from the other buttons if it comes with the same size. I'm controlling the buttons to resize it with each different size with the right hours of the tv program buttons with the right time and the right size, otherwise it will get mess it up if the buttons comes with all the same size.