Menu in Menu

  • #
    from enigma import *
    from Screens.Screen import Screen
    from Screens.MessageBox import MessageBox
    from Screens.InputBox import InputBox
    from Screens.ChoiceBox import ChoiceBox
    from Components.ActionMap import ActionMap, NumberActionMap
    from Components.ScrollLabel import ScrollLabel
    from Components.GUIComponent import *
    from Components.MenuList import MenuList
    from Components.Input import Input
    from Screens.Console import Console
    from Plugins.Plugin import PluginDescriptor
    from Screens.ImageWizard import ImageWizard
    from Plugins.Plugin import PluginDescriptor
    from EXTRAS2 import *
    import os



    def main(session,**kwargs):
    try:
    session.open(EXTRAS)


    def Plugins(**kwargs):
    return PluginDescriptor(
    name="EXTRAS",
    description="plugin to do cron daemon management",
    where = PluginDescriptor.WHERE_PLUGINMENU,
    fnc = main
    )



    class EXTRAS(Screen):
    skin = """
    <screen position="100,100" size="500,400" title="EXTRAS Menu" >
    <widget name="menu" position="10,10" size="490,390" scrollbarMode="showOnDemand" />
    </screen>"""

    def __init__(self, session, args = 0):
    self.skin = EXTRAS.skin
    self.session = session
    Screen.__init__(self, session)
    self.menu = args
    list = []
    list.append((_("Menu 2"), "addwizzard"))
    self["menu"] = MenuList(list)
    self["actions"] = ActionMap(["WizardActions", "DirectionActions"],{"ok": self.go,"back": self.close,}, -1)

    def go(self):
    returnValue = self["menu"].l.getCurrentSelection()[1]
    if returnValue is not None:
    if returnValue is "addwizzard":
    EXTRAS2(self.session)




    I ve got question



    How can I run 2nd Menu from Another file ??


    EXTRAS2(self.session)



    EXTRAS2 it is name of Class in 2nd file


    but it doesn't works


    when i run only EXTRAS2 ( as a plugin ) it is working fine


    an idea?

  • self.session.open(EXTRAS2)


    try this, like you used to openen EXTRAS. The only different is, that session is in a class accessable with self.session.