xboxscene.org forums

Author Topic: Sending Values To Childwindow ?  (Read 72 times)

bakman

  • Archived User
  • Newbie
  • *
  • Posts: 26
Sending Values To Childwindow ?
« on: April 07, 2005, 06:39:00 AM »

I am trying to create a script that will hold a lot of streaming movies, which I am collecting from the web. I am reading alexpoet's tutorial (great stuff!) but am loosing it. I would like to use childWindows (as that seems the easiest for me), one problem however, how can I push values from the parentwindow to the child window ?

for example; in the main window I have a list, once I make a selection I want to open a childwindow and get the selected value from the mainwindow to make a new selection.

below as described in the tutorial; this will only open a childwindow.
CODE

class MainClass(xbmcgui.Window):
   def __init__(self):
  if Emulating: xbmcgui.Window.__init__(self)
  self.addControl(xbmcgui.ControlImage(0,0,720,480, "Q:\\scripts\\Tutorial\\background.gif"))
  self.strActionInfo = xbmcgui.ControlLabel(100, 200, 200, 200, "", "font13", "0xFFFF00FF")
  self.addControl(self.strActionInfo)
  self.strActionInfo.setLabel("Push BACK to quit, or A to open another window.")
  self.strActionInfo = xbmcgui.ControlLabel(300, 300, 200, 200, "", "font13", "0xFFFFFFFF")
  self.addControl(self.strActionInfo)
  self.strActionInfo.setLabel("This is the first window")

   def onAction(self, action):
  if action == ACTION_PREVIOUS_MENU:
     self.close()
  if action == ACTION_SELECT_ITEM:
     popup = ChildClass()
     popup.doModal()
     del popup

class ChildClass(xbmcgui.Window):
   def __init__(self):
  if Emulating: xbmcgui.Window.__init__(self)
  self.addControl(xbmcgui.ControlImage(0,0,720,480, "Q:\\scripts\\Tutorial\\background.gif"))
  self.strActionInfo = xbmcgui.ControlLabel(100, 200, 200, 200, "", "font13", "0xFFFF00FF")
  self.addControl(self.strActionInfo)
  self.strActionInfo.setLabel("Push BACK to return to the first window")
  self.strActionInfo = xbmcgui.ControlLabel(300, 300, 200, 200, "", "font13", "0xFFFFFF99")
  self.addControl(self.strActionInfo)
  self.strActionInfo.setLabel("This is the child window")

   def onAction(self, action):
  if action == ACTION_PREVIOUS_MENU:
     self.close()

mydisplay = MainClass()
mydisplay.doModal()
del mydisplay

Logged