Code:
# Ihad.tv enigma2-plugin tutorial 2010
# lesson 01
# by emanuel
###########################################################################
from Screens.Screen import Screen
from Components.Label import Label
from Components.ActionMap import ActionMap
from Plugins.Plugin import PluginDescriptor
###########################################################################
class HalloWorldScreen(Screen):
skin = """
<screen position="130,150" size="460,150" title="Ihad.tv e2-tutorial lesson 1" >
<widget name="myLabel" position="10,60" size="200,40" font="Regular;20"/>
</screen>"""
def __init__(self, session, args = None):
self.session = session
Screen.__init__(self, session)
self["myLabel"] = Label(_("Hello World ;-)"))
self["myActionMap"] = ActionMap(["SetupActions"],
{
"cancel": self.close # add the RC Command "cancel" to close your Screen
}, -1)
###########################################################################
def main(session, **kwargs):
print "\n[Hallo World] start\n"
session.open(HalloWorldScreen)
###########################################################################
def Plugins(**kwargs):
return PluginDescriptor(
name="01 Hallo World",
description="lesson 1 - Ihad.tv e2-tutorial",
where = PluginDescriptor.WHERE_PLUGINMENU,
icon="../ihad_tut.png",
fnc=main)
Bookmarks