Thank you for the info but I am still troubled. Maybe its my ignorance of programing?? I have saved my .png file in the thumbnail folder in my add-on folder. I then zipped the entire add-on folder and used XBMC to upload the zip file. What am I doing wrong?
[# -*- coding: utf-8 -*-
# Licence: GPL v.3
http://www.gnu.org/licenses/gpl.html
# This is an XBMC addon for demonstrating the capabilities
# and usage of PyXBMCt framework.
import os
import xbmc, xbmcaddon, xbmcgui
from pyxbmct.addonwindow import *
_addon = xbmcaddon.Addon()
_addon_path = _addon.getAddonInfo('path').decode('utf-8')
_media_path = os.path.join(xbmc.translatePath(_addon_path),
'thumbnail')
class MyAddon(AddonDialogWindow):
def __init__(self, title=''):
"""Class constructor"""
# Call the base class' constructor.
super(MyAddon, self).__init__(title)
# Set width, height and the grid parameters
self.setGeometry(600, 400, 10, 3)
# Call set controls method
self.set_controls()
# Call set navigation method.
self.set_navigation()
# Connect Backspace button to close our addon.
self.connect(ACTION_NAV_BACK, self.close)
def set_controls(self):
"""Set up UI controls"""
# Image control
def get_image('slider.png'):
return os.path.join[/php](_media_path, 'slider.png')
self.placeControl(image, 0, 0, rowspan=2, columnspan=2)
# Text label left
label_left = Label('Left Ballast')
self.placeControl(label_left, 2, 0)
# Text label center
label_center = Label('Center Ballast')
self.placeControl(label_center, 2, 1)
# Text label right
label_right = Label('Right Ballast')
self.placeControl(label_right, 2, 2)
# Button Increase Left
self.increasel_buton = Button('Increase')
self.placeControl(self.increasel_buton, 3, 0)
# Button Increase Center
self.increasec_buton = Button('Increase')
self.placeControl(self.increasec_buton, 3, 1)
# Button Increase Left
self.increaser_buton = Button('Increase')
self.placeControl(self.increaser_buton, 3, 2)
# Button Decrease Left
self.decreasel_buton = Button('Decrease')
self.placeControl(self.decreasel_buton, 7, 0)
# Button Decrease Center
self.decreasec_buton = Button('Decrease')
self.placeControl(self.decreasec_buton, 7, 1)
# Button Decrease Right
self.decreaser_buton = Button('Decrease')
self.placeControl(self.decreaser_buton, 7, 2)
# Image control slider
image_a = Image('slider.png')
self.placeControl(image_a, 4, 0, rowspan=1, columnspan=1)
# Image control slider
image_b = Image('slider.png')
self.placeControl(image_b, 5, 0, rowspan=1, columnspan=1)
# Image control slider
image_c = Image('slider.png')
self.placeControl(image_c, 6, 0, rowspan=1, columnspan=1)
# Conect Increase Left Button
# Text edit control
self.name_field = Edit('')
self.placeControl(self.name_field, 8, 2)
# Close button
self.close_button = Button('Close')
self.placeControl(self.close_button, 8, 0)
# Connect close button
self.connect(self.close_button, self.close)
# Hello button.
self.hello_buton = Button('Hello')
self.placeControl(self.hello_buton, 3, 1)
# Connect Hello button.
self.connect(self.hello_buton, lambda:
xbmc.executebuiltin('Notification(Hello %s!, Welcome to PyXBMCt.)' %
self.name_field.getText()))
def set_navigation(self):
"""Set up keyboard/remote navigation between controls."""
self.name_field.controlUp(self.hello_buton)
self.name_field.controlDown(self.hello_buton)
self.close_button.controlLeft(self.hello_buton)
self.close_button.controlRight(self.hello_buton)
self.hello_buton.setNavigation(self.name_field, self.name_field, self.close_button, self.close_button)
# Set initial focus.
self.setFocus(self.name_field)
def slider_update(self):
# Update slider value label when the slider nib moves
try:
if self.getFocus() == self.slider:
self.slider_value.setLabel('%.1f' % self.slider.getPercent())
except (RuntimeError, SystemError):
pass
if __name__ == '__main__':
addon = MyAddon('PyXBMCt Example')
addon.doModal()
]