f20119124b2f789f75e5e2ae0f1816de259a9c5c
[openblackhole/openblackhole-enigma2.git] / lib / python / Plugins / example.py
1 from enigma import *
2 from Screens.Screen import Screen
3 from Screens.MessageBox import MessageBox
4
5 from Components.ActionMap import ActionMap
6 from Components.Label import Label
7
8 class Example(Screen):
9         skin = """
10                 <screen position="100,100" size="200,200" title="Example plugin..." >
11                         <widget name="text" position="0,0" size="100,50" font="Regular;23" />
12                 </screen>"""
13                 
14         def __init__(self, session):
15                 self.skin = Example.skin
16                 Screen.__init__(self, session)
17
18                 self["text"] = Label("Big test")
19
20                 self["actions"] = ActionMap(["WizardActions"], 
21                 {
22                         "ok": self.ok,
23                         "back": self.close
24                 }, -1)
25                 
26         def ok(self):
27                 self.session.open(MessageBox, "Bla bla bla bla bla bla bla bla\n bla bla bla bla bla bla\n bla bla bla bla bla bla\n bla bla bla bla bla", MessageBox.TYPE_YESNO)
28                                 
29 def main(session):
30         session.open(Example)
31         
32
33 def getPicturePath():
34                 return "/usr/share/enigma2/record.png"
35
36 def getPluginName():
37                 return "Fancy example-plugin"