def build_gui ( self , container ) : vbox = Widgets . VBox ( ) vbox . set_border_width ( 0 ) w = Viewers . GingaViewerWidget ( viewer = self ) vbox . add_widget ( w , stretch = 1 ) # need to put this in an hbox with an expanding label or the # browser wants to resize the canvas, distorting it hbox = Widgets . HBox ( ) hbox . add_widget ( vbox , stretch = 0 ) hbox . add_widget ( Widgets . Label ( '' ) , stretch = 1 ) container . set_widget ( hbox )
a canvas is not a widget used in python to create a graphic design
This is responsible for building the viewer s UI . It should place the UI in container . Override this to make a custom UI .
def build_gui(self, container):
        """
        This is responsible for building the viewer's UI.  It should
        place the UI in `container`.  Override this to make a custom
        UI.
        """
        vbox = Widgets.VBox()
        vbox.set_border_width(0)

        w = Viewers.GingaViewerWidget(viewer=self)
        vbox.add_widget(w, stretch=1)

        # need to put this in an hbox with an expanding label or the
        # browser wants to resize the canvas, distorting it
        hbox = Widgets.HBox()
        hbox.add_widget(vbox, stretch=0)
        hbox.add_widget(Widgets.Label(''), stretch=1)

        container.set_widget(hbox)