controls the width size for xbmcgui.controlbutton
#1
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:

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.
Reply
#2
24 hours and no one is answer it?

If you don't understand what I'm trying to do, here it is:

I'm creating the buttons with each different size as the one is for 342.05 and the other one is for 691.09. The button with the size 342.05 is for 30 mins program and the button with size 691.09 is for 1 hour program. I want to resizing the buttons for my tv guide. Smile

There is a bit of a problem. If I resizing the buttons to change it from 691.09 to 342.05, how do I know which buttons is for the 30 mins program and the other button is for 1 hour program that both buttons will show 342?
Reply

Logout Mark Read Team Forum Stats Members Help
controls the width size for xbmcgui.controlbutton0