2013-09-20, 11:34
I'm writing my own mini-framework to simplify creating UI for XBMC addons. The framework is supposed to roughly imitate the behavior of QWidged class with QGridLayout from PyQt.
So far everything work OK. Using the simple code like:
I'm able to create the toplevel window in the center of the screen and then set Controls on it using placeControl() method which works exactly like QGridLayout.addWidget().
However, to create a control I still have to provide it with fake coordinates and size, e.g.:
Then I decided to sub-class some Controls and provide fake parameters inside a class:
But I'm getting error messages stating that Label still requires an integer parameter (coordinate?).
The question is: what am I doing wrong?
P.S. My mini-framework on Gihgub: https://github.com/romanvm/XBMC-addon-window
So far everything work OK. Using the simple code like:
PHP Code:
from addonwindow.addonwindow import *
class MyAddon(AddonDialogWindow):
def __init__(self, title):
AddonDialogWindow.__init__(self, title)
self.setGeometry(400, 400)
self.setGrid(4, 4)
window = MyAddon('Hello World!')
window.doModal()
del window
I'm able to create the toplevel window in the center of the screen and then set Controls on it using placeControl() method which works exactly like QGridLayout.addWidget().
However, to create a control I still have to provide it with fake coordinates and size, e.g.:
PHP Code:
self.label = xbmcgui.ControlLabel(1, 1, 1, 1, 'Simple label')
PHP Code:
class Label(xbmcgui.ControlLabel):
def __init__(self, *args, **kwargs):
xbmcgui.ControlLabel.__init__(self, 1, 1, 1, 1, *args, **kwargs)
...
self.label = Label('Simple label')
But I'm getting error messages stating that Label still requires an integer parameter (coordinate?).
The question is: what am I doing wrong?
P.S. My mini-framework on Gihgub: https://github.com/romanvm/XBMC-addon-window