python xbmc

תוכנות ניהול מדיה: KODI, תוספים, XBMC, Media Portal, PLEX וכו'
nironiro פותח השרשור
חבר פעיל מאוד
חבר פעיל מאוד
תגובות: 125
הצטרף: ספטמבר 2007
נתן תודות: 1 פעם
קיבל תודות: 3 פעמים

שליחה #1 

היי שלום לכולם

אני כבר שעות מנסה ליצור תמונה שהיא כפתור

מישהו יכול להגיד לי אולי איך אני עושה את זה

זה הקוד שיש לי



import json
import os

__addon__ = xbmcaddon.Addon()
__addon_id__ = __addon__.getAddonInfo('id')
__addonpath__ = xbmc.translatePath(__addon__.getAddonInfo('path'))
__datapath__ = xbmc.translatePath(os.path.join('special://profile/addon_data/', __addon_id__)).replace('\\', '/') + '/'
__path_img__ = __addonpath__ + '/images/'
__lang__ = __addon__.getLocalizedString




#get actioncodes from https://github.com/xbmc/xbmc/blob/maste ... ilib/Key.h
ACTION_PREVIOUS_MENU = 10
ACTION_SELECT_ITEM = 7
ACTION_MOVE_UP = 3
ACTION_MOVE_DOWN = 4
ACTION_STEP_BACK = 21
ACTION_NAV_BACK = 92
ACTION_MOUSE_RIGHT_CLICK = 101
ACTION_MOUSE_MOVE = 107
ACTION_BACKSPACE = 110
KEY_BUTTON_BACK = 275



class MyClass(xbmcgui.WindowDialog):
def __init__(self):
self.addControl(xbmcgui.ControlImage(200,150,600,400, __path_img__ + 'bg.png'))

self.strActionInfo = xbmcgui.ControlLabel(100, 120, 200, 200, '', 'font13', '0xFFFF00FF')
self.button0 = xbmcgui.ControlButton(350, 500, 80, 80, 'test' )
self.addControl(self.button0)
self.setFocus(self.button0)

self.addControl(self.strActionInfo)
self.strActionInfo.setLabel('Push BACK to quit, A to display text and B to erase it')




def onAction(self, action):
if action == ACTION_PREVIOUS_MENU:
self.close()

def onControl(self, control):
if control == self.button0:
self.message('you pushed the button')

def message(self, message):
dialog = xbmcgui.Dialog()
dialog.ok(" My message title", message)

mydisplay = MyClass()
mydisplay .doModal()
del mydisplay

יש לי כפתור שהוא עובד אבל אני רוצה שזה יהיה תמונה פשוט שיושבת בתקיה של הפלאג

אם זה לא המקום לשאול אז בבקשה איפה אפשר לקבל עזרה

שלח תגובה

חזור אל “תוכנה - KODI”