2 from Components.Label import Label
7 def __init__(self,session,name="no Name",description="unknown Description",version="unknown Version",author="unknown Author",homepage="http://www.unknown.de"):
10 self.description = description
11 self.version = version
12 self.homepage = homepage
13 self.session = session
14 self.dir = "" # the directory the widget is saved in the filesystem
15 self.elements ={} # contains all Labels etc.
16 self.prefix = "" # the prefix of the name of the elements after it is patched into the main screen skin depending on its place in the widgetdesktop
17 self.wname = "" # the place name, the widget is placed and running in
19 def setDir(self,directory):
20 """ called after the import """
23 def setPositionname(self,wname):
24 """ called after the widget is placed at a place at the widgetdesktop """
26 self.prefix = wname+"_e_"
28 def getElement(self,elementname):
29 """ returns the intance of an element of self.elements """
30 return self.instance[self.prefix+elementname]
32 def onLoadFinished(self,instance):
33 """ overwrite this in your widget to do things after the widget is shown on the widgetdesktop """
34 self.instance = instance
37 """ overwrite this, if you have to stop things when the widgetdesktop """
41 """ overwrite this, if you whant to do something if the user presses the info-key and your widget is selected """
42 print "unhandled infokey"