Mercurial > libervia-web
diff browser_side/dialog.py @ 41:7782a786b2f0
Tarot game: score is now shown (need to use XMLUI later)
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 22 May 2011 17:56:59 +0200 |
parents | 305e81c7a32c |
children | 71a9cc9b9d57 |
line wrap: on
line diff
--- a/browser_side/dialog.py Sun May 22 00:17:47 2011 +0200 +++ b/browser_side/dialog.py Sun May 22 17:56:59 2011 +0200 @@ -24,6 +24,7 @@ from pyjamas.ui.DialogBox import DialogBox from pyjamas.ui.ListBox import ListBox from pyjamas.ui.Button import Button +from pyjamas.ui.HTML import HTML class ContactsChooser(DialogBox): @@ -109,3 +110,20 @@ self.hide() self.callback(False) +class SimpleDialog(DialogBox): + + def __init__(self, title, body): + """Simple notice dialog box + @param title: HTML put in the header + @param body: HTML put in the body""" + DialogBox.__init__(self, centered=True) + _body = VerticalPanel() + _body.setSpacing(4) + _body.add(HTML(body)) + _body.add(Button("Close", self.onClose)) + _body.setStyleName("dialogBody") + self.setHTML(title) + self.setWidget(_body) + + def onClose(self): + self.hide()