PageRenderTime 20ms CodeModel.GetById 11ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/mail/Shortcuts.py

http://pyjamas.googlecode.com/
Python | 24 lines | 19 code | 5 blank | 0 comment | 0 complexity | 023d1985edc7c0ef10ff26c7d949663c MD5 | raw file
 1from ui import Composite, StackPanel, Label
 2from Tasks import Tasks
 3from Mailboxes import Mailboxes
 4from Contacts import Contacts
 5
 6class Shortcuts(Composite):
 7
 8    def __init__(self):
 9        stackPanel = StackPanel()
10        stackPanel.add(Mailboxes(), self.createHeaderHTML("mailgroup.gif", "Mail"), True)
11        stackPanel.add(Tasks(), self.createHeaderHTML("tasksgroup.gif", "Tasks"), True)
12        stackPanel.add(Contacts(), self.createHeaderHTML("contactsgroup.gif", "Contacts"), True)
13
14        stackPanel.showStack(0)
15
16        self.initWidget(stackPanel)
17
18    def createHeaderHTML(self, imageUrl, caption):
19        header =  "<table align='left'><tr>" + "<td><img src='"
20        header += "http://code.google.com/webtoolkit/documentation/examples/desktopclone/"
21        header += imageUrl + "'></td>"
22        header += "<td style='vertical-align:middle'><b style='white-space:nowrap'>"
23        header +=  caption + "</b></td>" + "</tr></table>"
24        return header