Skip to content
Newer
Older
100644 34 lines (25 sloc) 1.26 KB
46bb901 move kitchensink sink in as a pyjamas widget
Luke Leighton authored Mar 24, 2012
1 from pyjamas.ui.Sink import Sink, SinkInfo
7a39225 merge dynamic branch manually
lkcl authored Mar 9, 2009
2 from pyjamas.ui.Grid import Grid
3 from pyjamas.ui.FlexTable import FlexTable
4 from pyjamas.ui import HasHorizontalAlignment
5 from pyjamas.ui.Image import Image
04ee480 first svn add of trunk
lkcl authored Sep 15, 2008
6
7 class Tables(Sink):
8 def __init__(self):
7a39225 merge dynamic branch manually
lkcl authored Mar 9, 2009
9 Sink.__init__(self)
1ed2c49 reworking lots more classes/panels - #34
lkcl authored Jul 10, 2009
10 inner = Grid(10, 5, Width="100%", BorderWidth="1")
11 outer = FlexTable(Width="100%", BorderWidth="1")
04ee480 first svn add of trunk
lkcl authored Sep 15, 2008
12
13 outer.setWidget(0, 0, Image(self.baseURL() + "rembrandt/LaMarcheNocturne.jpg"))
14 outer.getFlexCellFormatter().setColSpan(0, 0, 2)
15 outer.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER)
16
17 outer.setHTML(1, 0, "Look to the right...<br>That's a nested table component ->")
18 outer.setWidget(1, 1, inner)
19 outer.getCellFormatter().setColSpan(1, 1, 2)
20
21 for i in range(10):
22 for j in range(5):
e99cd70 whoops mess...
lkcl authored Jun 24, 2009
23 inner.setText(i, j, "%d" % i + ",%d" % j)
04ee480 first svn add of trunk
lkcl authored Sep 15, 2008
24
25 self.initWidget(outer)
26
27 def onShow(self):
28 pass
29
30 def init():
31 text="The <code>FlexTable</code> widget doubles as a tabular data formatter and a panel. In this example, you'll see that there is an outer table with four cells, two of which contain nested components."
306ef68 fix import issues
lkcl authored Oct 17, 2008
32 return SinkInfo("Tables", text, Tables)
33
Something went wrong with that request. Please try again.