2014-12-08, 12:10
Hi guys
I have a problem with my code, I'm adding the list of buttons and when I try to use the setFocus to force the image to show up on the button using the value, it will not show the image on the first button.
Here is the code:
Here is the screenshot:
When I use this:
It will still not show the image on the first button.
Can you please tell me how I can get the image to show on the first button when I use the setFocus to force the image to show up?
I have a problem with my code, I'm adding the list of buttons and when I try to use the setFocus to force the image to show up on the button using the value, it will not show the image on the first button.
Here is the code:
Code:
def __init__(self):
self.program_buttons = []
self.channels_Index = 0
self.programs_Index = 0
def MyChannels(self, *controlIds):
#get the programs list
cur = con.cursor()
cur.execute('SELECT channel, title, start_date, stop_date FROM programs WHERE channel=? LIMIT 3', [channel])
programList = list()
programs = cur.fetchall()
start_pos = 375 # indent for first program
for ind, row in enumerate(programs):
program = row[1].encode('ascii'), str(row[2]), str(row[3])
title = row[1].encode('ascii')
program_title = '[B]' + title + '[/B]'
button_focus = 'channels_yellow.png'
button_nofocus = 'channels_bar1.png'
program_controls = xbmcgui.ControlButton(
int(position_start),
int(position_top),
int(program_width),
int(program_height),
program_title,
focusTexture = button_focus,
noFocusTexture = button_nofocus,
textColor = text_color,
)
self.addControl(program_controls)
self.program_buttons.append(program_controls)
cur.close()
if len(self.program_buttons) > 0:
self.setFocus(self.program_buttons[0])
Here is the screenshot:
When I use this:
Code:
#if len(self.program_buttons) > 0:
#self.setFocus(self.program_buttons[0])
It will still not show the image on the first button.
Can you please tell me how I can get the image to show on the first button when I use the setFocus to force the image to show up?