예제 #1
0
 def init(self, retico_widget):
     self.retico_widget = retico_widget
     with flx.PinboardLayout(
             style="height: 3000px; width: 3000px;") as self.mcontainer:
         self.canvas = flx.CanvasWidget(
             style="left: 0; top: 0; height:100%; width: 100%;")
     self.modules = []
     self.init_moving()
     window.setTimeout(self.center_view, 10)
예제 #2
0
    def init(self, model):
        super().init()
        self.model = model

        # App layout
        with flx.VBox():
            flx.Label(flex=0, text=lambda: model.status)
            flx.Widget(flex=1)
            with flx.HBox(flex=2):
                flx.Widget(flex=1)
                self.canvas = flx.CanvasWidget(flex=0, minsize=400, maxsize=400)
                flx.Widget(flex=1)
            flx.Widget(flex=1)

        # Init context to draw to
        self._ctx = self.canvas.node.getContext('2d')