2013-12-11, 16:28
I am putting together a small framework written in Python that should simplify the conversion of list based addons into graphical addons.
The way I have implemented it you can spend just a few minutes (literally) making a couple of simple changes to a default.py and all the lists will still be populated as usual but instead of appearing in the usual XBMC lists, the information will instead appear in a list within a graphical window (xbmc.windowXML) which you as a developer then have complete control of to extend as you wish (via the window's XML file).
I have however run into a problem trying to implement the context menu functionality.
I assume that because the code runs as a script rather than a plugin I can't do the usual
Although that isn't the actual problem; so in my code onAction is triggered and I can retrieve the appropriate list of tuples that make up the context menu I want to create.
So how do I then go about creating a context menu and displaying it in the middle of the screen like the standard one does? I would like it to use the existing XML if possible;
So that it looks like the standard context menu regardless of the current selected skin. I would also like it to resize according to how many items are in the menu, like the standard one does.
If it is important I am using a list with ID 59 in my window to display the list items from which I want to invoke the context menu.
Any help would be most appreciated, but please go easy on me, I'm fairly new to XBMC skinning!
The way I have implemented it you can spend just a few minutes (literally) making a couple of simple changes to a default.py and all the lists will still be populated as usual but instead of appearing in the usual XBMC lists, the information will instead appear in a list within a graphical window (xbmc.windowXML) which you as a developer then have complete control of to extend as you wish (via the window's XML file).
I have however run into a problem trying to implement the context menu functionality.
I assume that because the code runs as a script rather than a plugin I can't do the usual
Code:
contextMenu = []
#populate context menu
liz.addContextMenuItems(contextMenu)
Although that isn't the actual problem; so in my code onAction is triggered and I can retrieve the appropriate list of tuples that make up the context menu I want to create.
So how do I then go about creating a context menu and displaying it in the middle of the screen like the standard one does? I would like it to use the existing XML if possible;
Code:
DialogContextMenu.xml
So that it looks like the standard context menu regardless of the current selected skin. I would also like it to resize according to how many items are in the menu, like the standard one does.
If it is important I am using a list with ID 59 in my window to display the list items from which I want to invoke the context menu.
Any help would be most appreciated, but please go easy on me, I'm fairly new to XBMC skinning!