Activating and xml window from C++
#1
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.
Reply
#2
you have to add an offset to the window id, see WindowIDs.h or thereabout.
Reply
#3
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?
Reply
#4
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.
Reply
#5
My window ID is 32. Hence wrote like this:

if (!g_windowManager.IsWindowActive(11132))
g_windowManager.ActivateWindow(11132);

But it didn't work.
Reply
#6
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
Reply
#7
then it all makes sense. that window ain't instanced until you run that script, so the window manager won't find it.
Reply

Logout Mark Read Team Forum Stats Members Help
Activating and xml window from C++0