geminicode
January 7th, 2011, 09:53 PM
I'm trying to create a menu system similar to what the Boxee Netflix app uses. I'd like a vertical list box to contain the menu items and be aligned on the left. Each menu item would open a new window and the menu's list onclick looks something like this..
<onclick lang="python"><![CDATA[
list = mc.GetActiveWindow().GetList(200)
list_foc = list.GetFocusedItem()
if list_foc == 0: # window 1
mc.ActivateWindow(14001)
if list_foc == 1: # window 2
mc.ActivateWindow(14002)
if list_foc == 2: # window 3
mc.ActivateWindow(14003)
if list_foc == 3: # exit the app
mc.GetApp().Close()
]]></onclick>
This menu is duplicated on all windows. Each of the windows (14001, 14002, 14003) have an onload and unload events...
<onload lang="python"><![CDATA[
# set the menu list selected item to current window
mc.GetWindow(14002).GetList(200).SetFocusedItem(1)
]]></onload>
<onunload lang="python"><![CDATA[
# Not sure what this is doing if anything
mc.GetWindow(14002).ClearStateStack(False)
]]></onunload>
As windows are opened from the onclick of the list item I don't want the window to be "added to the stack". In other words I don't want the user to ESC to the previous window. I really want to close the window that the user just left and have the newly opened window be the active and only window. Is ClearStateStack(False) the appropiate function? Can this even be done?
I don't see how one can ActiveWindow() and then CloseWindow() on the previous window.
Any help would be appreciated.
Thanks,
Darrell
<onclick lang="python"><![CDATA[
list = mc.GetActiveWindow().GetList(200)
list_foc = list.GetFocusedItem()
if list_foc == 0: # window 1
mc.ActivateWindow(14001)
if list_foc == 1: # window 2
mc.ActivateWindow(14002)
if list_foc == 2: # window 3
mc.ActivateWindow(14003)
if list_foc == 3: # exit the app
mc.GetApp().Close()
]]></onclick>
This menu is duplicated on all windows. Each of the windows (14001, 14002, 14003) have an onload and unload events...
<onload lang="python"><![CDATA[
# set the menu list selected item to current window
mc.GetWindow(14002).GetList(200).SetFocusedItem(1)
]]></onload>
<onunload lang="python"><![CDATA[
# Not sure what this is doing if anything
mc.GetWindow(14002).ClearStateStack(False)
]]></onunload>
As windows are opened from the onclick of the list item I don't want the window to be "added to the stack". In other words I don't want the user to ESC to the previous window. I really want to close the window that the user just left and have the newly opened window be the active and only window. Is ClearStateStack(False) the appropiate function? Can this even be done?
I don't see how one can ActiveWindow() and then CloseWindow() on the previous window.
Any help would be appreciated.
Thanks,
Darrell