GUI window class for Add-Ons.
More...
GUI window class for Add-Ons.
This class allows over their functions to create and edit windows that can be accessed from an Add-On.
Likewise, all functions from here as well in the other window classes WindowDialog, WindowXML and WindowXMLDialog with inserted and available.
Constructor for window
Class: xbmcgui.Window([existingWindowId]):
Creates a new from Add-On usable window class. This is to create window for related controls by system calls.
- Parameters
-
existingWindowId | [opt] Specify an id to use an existing window. |
- Exceptions
-
ValueError | if supplied window Id does not exist. |
Exception | if more then 200 windows are created. |
Deleting this window will activate the old window that was active and resets (not delete) all controls that are associated with this window.
Example:
..
win = xbmcgui.Window()
width = win.getWidth()
..
◆ addControl()
void XBMCAddon::xbmcgui::Window::addControl |
( |
| ... | ) |
|
Function: addControl(Control)
Add a
Control to this window.
- Parameters
-
- Exceptions
-
TypeError | If supplied argument is not a Control type |
ReferenceError | If control is already used in another window |
RuntimeError | Should not happen :-) |
The next controls can be added to a window atm
Control-class | Description |
ControlLabel | Label control to show text |
ControlFadeLabel | The fadelabel has multiple labels which it cycles through |
ControlTextBox | To show bigger text field |
ControlButton | Brings a button to do some actions |
ControlEdit | The edit control allows a user to input text in Kodi |
ControlFadeLabel | The fade label control is used for displaying multiple pieces of text in the same space in Kodi |
ControlList | Add a list for something like files |
ControlGroup | Is for a group which brings the others together |
ControlImage | Controls a image on skin |
ControlRadioButton | For a radio button which handle boolean values |
ControlProgress | Progress bar for a performed work or something else |
ControlSlider | The slider control is used for things where a sliding bar best represents the operation at hand |
ControlSpin | The spin control is used for when a list of options can be chosen |
ControlTextBox | The text box is used for showing a large multipage piece of text in Kodi |
◆ addControls()
void XBMCAddon::xbmcgui::Window::addControls |
( |
| ... | ) |
|
Function: addControls(List)
Add a list of Controls to this window.
- Parameters
-
- Exceptions
-
TypeError | If supplied argument is not of List type, or a control is not of Control type |
ReferenceError | If control is already used in another window |
RuntimeError | Should not happen :-) |
◆ clearProperties()
void XBMCAddon::xbmcgui::Window::clearProperties |
( |
| ) |
|
Function: clearProperties()
Clears all window properties.
Example:
..
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
win.clearProperties()
..
◆ clearProperty()
void XBMCAddon::xbmcgui::Window::clearProperty |
( |
| ... | ) |
|
Function: clearProperty(key)
Clears the specific window property.
- Parameters
-
key | string - property name. |
- Note
- Key is NOT case sensitive. Equivalent to setProperty(key,'') You can use the above as keywords for arguments and skip certain optional arguments. Once you use a keyword, all following arguments require the keyword.
Example:
..
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
win.clearProperty('Category')
..
◆ close()
void XBMCAddon::xbmcgui::Window::close |
( |
| ) |
|
Function: close()
Closes this window.
Closes this window by activating the old window.
- Note
- The window is not deleted with this method.
◆ doModal()
void XBMCAddon::xbmcgui::Window::doModal |
( |
| ) |
|
Function: doModal()
Display this window until
close() is called.
◆ getControl()
Control * XBMCAddon::xbmcgui::Window::getControl |
( |
| ... | ) |
|
Function: getControl(controlId)
Gets the control from this window.
- Parameters
-
- Exceptions
-
- Note
- Not python controls are not completely usable yet You can only use the Control functions
◆ getFocus()
Control * XBMCAddon::xbmcgui::Window::getFocus |
( |
| ) |
|
Function: getFocus(Control)
Returns the control which is focused.
- Returns
- Focused control class
- Exceptions
-
SystemError | On Internal error |
RuntimeError | If no control has focus |
◆ getFocusId()
long XBMCAddon::xbmcgui::Window::getFocusId |
( |
| ) |
|
Function: getFocusId(int)
Returns the id of the control which is focused.
- Returns
- Focused control id
- Exceptions
-
SystemError | On Internal error |
RuntimeError | If no control has focus |
◆ getHeight()
long XBMCAddon::xbmcgui::Window::getHeight |
( |
| ) |
|
◆ getProperty()
String XBMCAddon::xbmcgui::Window::getProperty |
( |
| ... | ) |
|
Function: getProperty(key)
Returns a window property as a string, similar to an infolabel.
- Parameters
-
key | string - property name. |
- Note
- Key is NOT case sensitive.
You can use the above as keywords for arguments and skip certain optional arguments. Once you use a keyword, all following arguments require the keyword.
Example:
..
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
category = win.getProperty('Category')
..
◆ getWidth()
long XBMCAddon::xbmcgui::Window::getWidth |
( |
| ) |
|
◆ removeControl()
void XBMCAddon::xbmcgui::Window::removeControl |
( |
| ... | ) |
|
Function: removeControl(Control)
Removes the control from this window.
- Parameters
-
- Exceptions
-
TypeError | If supplied argument is not a Control type |
RuntimeError | If control is not added to this window |
This will not delete the control. It is only removed from the window.
◆ removeControls()
void XBMCAddon::xbmcgui::Window::removeControls |
( |
| ... | ) |
|
Function: removeControls(List)
Removes a list of controls from this window.
- Parameters
-
- Exceptions
-
TypeError | If supplied argument is not a Control type |
RuntimeError | If control is not added to this window |
This will not delete the controls. They are only removed from the window.
◆ setFocus()
void XBMCAddon::xbmcgui::Window::setFocus |
( |
| ... | ) |
|
Function: setFocus(Control)
Give the supplied control focus.
- Parameters
-
- Exceptions
-
TypeError | If supplied argument is not a Control type |
SystemError | On Internal error |
RuntimeError | If control is not added to a window |
◆ setFocusId()
void XBMCAddon::xbmcgui::Window::setFocusId |
( |
| ... | ) |
|
Function: setFocusId(ControlId)
Gives the control with the supplied focus.
- Parameters
-
ControlId | [integer] On skin defined id of control |
- Exceptions
-
SystemError | On Internal error |
RuntimeError | If control is not added to a window |
◆ setProperty()
void XBMCAddon::xbmcgui::Window::setProperty |
( |
| ... | ) |
|
Function: setProperty(key, value)
Sets a window property, similar to an infolabel.
- Parameters
-
key | string - property name. |
value | string or unicode - value of property. |
- Note
- Key is NOT case sensitive. Setting value to an empty string is equivalent to clearProperty(key).
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
Example:
..
win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
win.setProperty('Category', 'Newest')
..
◆ show()
void XBMCAddon::xbmcgui::Window::show |
( |
| ) |
|
Function: show()
Show this window.
Shows this window by activating it, calling close() after it wil activate the current window again.
- Note
- If your script ends this window will be closed to. To show it forever, make a loop at the end of your script or use doModal() instead.