Posts: 52
Joined: Jun 2014
Reputation:
0
Hi,
Can anyone let me know how to use g_windowManager.ActivateWindow to call a window (say MyPVRInclude.xml) from C++ side?
We need a window ID to call but when I gave a existing ID it didn't work.
Posts: 1,506
Joined: Nov 2013
you have to add an offset to the window id, see WindowIDs.h or thereabout.
Posts: 52
Joined: Jun 2014
Reputation:
0
Hi ironic_monkey,
Thanks for the reply.
I could not find WindowIDs.h. Is it key.h ? The one that has Window IDs? Anyways how can I call my own window (defined in my skin) from C++ side?
Posts: 1,506
Joined: Nov 2013
2014-12-09, 13:04
(This post was last modified: 2014-12-09, 13:04 by ironic_monkey.)
it's in guilib, sitting alongside Key.h
https://github.com/xbmc/xbmc/blob/master...indowIDs.h
according to that file you add 11100 to your window id.
Posts: 52
Joined: Jun 2014
Reputation:
0
My window ID is 32. Hence wrote like this:
if (!g_windowManager.IsWindowActive(11132))
g_windowManager.ActivateWindow(11132);
But it didn't work.
Posts: 52
Joined: Jun 2014
Reputation:
0
Hi,
I was able to get this done by this.
Write this in C++:
CBuiltins *pBuiltin = new CBuiltins();
pBuiltin->Execute("XBMC.RunScript(/storage/.xbmc/addons/script.showlivetvsettings/default.py)");
Let the python script do the rest:
This is what the python script is doing:
import xbmcgui
import os
window = xbmcgui.WindowXMLDialog('MyPVR.xml', os.getcwd(), 'LCARS', 'PAL')
window.doModal()
del window
Posts: 1,506
Joined: Nov 2013
then it all makes sense. that window ain't instanced until you run that script, so the window manager won't find it.