comparison browser_side/dialog.py @ 42:71a9cc9b9d57

Browser side: Tarot game - draw game managed - we can now play continuously \o/
author Goffi <goffi@goffi.org>
date Mon, 23 May 2011 00:45:19 +0200
parents 7782a786b2f0
children a7ff1e6f1229
comparison
equal deleted inserted replaced
41:7782a786b2f0 42:71a9cc9b9d57
110 self.hide() 110 self.hide()
111 self.callback(False) 111 self.callback(False)
112 112
113 class SimpleDialog(DialogBox): 113 class SimpleDialog(DialogBox):
114 114
115 def __init__(self, title, body): 115 def __init__(self, title, body, callback = None):
116 """Simple notice dialog box 116 """Simple notice dialog box
117 @param title: HTML put in the header 117 @param title: HTML put in the header
118 @param body: HTML put in the body""" 118 @param body: HTML put in the body"""
119 DialogBox.__init__(self, centered=True) 119 DialogBox.__init__(self, centered=True)
120 self.callback = callback
120 _body = VerticalPanel() 121 _body = VerticalPanel()
121 _body.setSpacing(4) 122 _body.setSpacing(4)
122 _body.add(HTML(body)) 123 _body.add(HTML(body))
123 _body.add(Button("Close", self.onClose)) 124 _body.add(Button("Close", self.onClose))
124 _body.setStyleName("dialogBody") 125 _body.setStyleName("dialogBody")
125 self.setHTML(title) 126 self.setHTML(title)
126 self.setWidget(_body) 127 self.setWidget(_body)
127 128
128 def onClose(self): 129 def onClose(self):
129 self.hide() 130 self.hide()
131 if self.callback:
132 self.callback()