Window manager - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Window manager (/showthread.php?tid=101358) |
Window manager - bartsidee - 2011-05-12 Is there a python function in xbmc or has maybe anyone created a class that resembles a window/stack manager. I'm busy with a skin addon and I'm trying to manage the use of gui windows. I want to reuse the window xml with new content/updated list to get an menu like effect. I can set this up by calling a new window from within class of the current window. On menu/return I just close the current window which will return the user to the previous window. So far so good. But what if I wanted more advanced function, for example: My user is in current gui 6, with stack: Gui 1-> Gui2 -> Gui3 -> Gui4 -> Gui5 -> Gui6 It wants directly to Gui2. I have to close gui6,gui5,gui4 and gui3 simultaneously. Another situation: My user is in Gui6 but wants to clear Gui1 -Gui5, making gui6 first in line/stack... Any ideas how to create such a stack control? or maybe some location where I get some inspiration to construct it? I think I need to somehow pass the window instances in a list when opening a new window, as such a can control the close property of those windows. - jmarshall - 2011-05-13 XBMC's window manager acts pretty much how you suggest. We have a window history stack, and when you go to a window, it checks the stack and if we find the window we're going to in the history, we clear all history from that window onwards, leaving id 1 and id 2 only on the stack in your example above. This applies to windows only, not dialogs. Thus, I'm not sure whether you'll actually need to do anything? - bartsidee - 2011-05-13 Thanks jmarshall, Is it possible to point me to some example code or reference projects that act in simular situation? Might be helpfull. - jmarshall - 2011-05-15 You can have a look at the stack in GUIWindowManager.cpp if that will be of any help? |