Are the UI controls supposed to work out of the box?

37 views
Skip to first unread message

Tabam

unread,
Dec 20, 2014, 5:47:45 AM12/20/14
to pyjs-...@googlegroups.com
Total beginner, I've worked through some examples and I'm trying to get ui.DockPanel to load, but all I get is white space under the formatted text:http://pyjs.org/examples/Showcase.html#test

Shouldn't I at least see labels?  Here is the source code:


from pyjamas.ui.SimplePanel import SimplePanel
from pyjamas.ui.DockPanel import DockPanel
from pyjamas.ui.Label import Label
from pyjamas.ui import HasAlignment

class DockPanelDemo(SimplePanel):
    def __init__(self):
        SimplePanel.__init__(self)

        panel = DockPanel(BorderWidth=1, Padding=8,
                          HorizontalAlignment=HasAlignment.ALIGN_CENTER,
                          VerticalAlignment=HasAlignment.ALIGN_MIDDLE)

        north  = Label("North")
        west   = Label("West")
        center = Label("Center")
        east   = Label("East")
        south  = Label("South")

        panel.add(north,  DockPanel.NORTH)
        panel.add(west,   DockPanel.WEST)
        panel.add(center, DockPanel.CENTER)
        panel.add(east,   DockPanel.EAST)
        panel.add(south,  DockPanel.SOUTH)

        panel.setCellHeight(center, "200px")
        panel.setCellWidth(center, "400px")

        self.add(panel)


Greg Warner

unread,
Jan 6, 2015, 12:18:57 AM1/6/15
to pyjs-...@googlegroups.com
I believe you need to instantiate an instance of your DockPanelDemo and add it to a RootPanel.  See: https://github.com/pyjs/pyjs/blob/master/examples/helloworld/Hello.py

Greg

--

---
You received this message because you are subscribed to the Google Groups "Pyjs.org Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyjs-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages