Beispiel #1
0
 def _view_factory(self, grps):
     v = View(grps,
              resizable=self.resizable,
              x=self.window_x,
              y=self.window_y,
              title=self.title,
              handler=self.handler_klass)
     if self.window_width:
         v.width = self.window_width
     if self.window_height:
         v.height = self.window_height
     return v
Beispiel #2
0
 def _view_factory(self, grps):
     v = View(grps,
                 resizable=self.resizable,
                 x=self.window_x,
                 y=self.window_y,
                 title=self.title,
                 handler=self.handler_klass
                 )
     if self.window_width:
         v.width = self.window_width
     if self.window_height:
         v.height = self.window_height
     return v
Beispiel #3
0
    def _view_factory(self, grps):
        v = View(grps,
                    resizable=self.resizable,
                    x=self.window_x,
                    y=self.window_y,
                    title=self.title,
                    handler=self.handler_klass,
#                    buttons=[Action(name='Save', action='save')]
                    )

        if self.window_width:
            v.width = self.window_width
        if self.window_height:
            v.height = self.window_height
        return v
Beispiel #4
0
    def _view_factory(self, grps):
        v = View(
            grps,
            resizable=self.resizable,
            x=self.window_x,
            y=self.window_y,
            title=self.title,
            handler=self.handler_klass,
            #                    buttons=[Action(name='Save', action='save')]
        )

        if self.window_width:
            v.width = self.window_width
        if self.window_height:
            v.height = self.window_height
        return v
                                                         func.doc_string)

    def set_text(self, text):
        """ Display a message in the help window.

            The text message is wrapped in html tags so that it displays
            correctly in the html window.
        """
        self._html = self._htmlify(text)

    def set_html(self, html):
        """ Display html text without modification into the window.
        """
        self._html = html


    ### private methods ######################################################


    def _htmlify(self, text):
        """ Add <html> and <body> tags around text so that it is valid html.
        """
        return "<html>\n<body>\n%s\n</body>\n</html>" % text


if __name__ == "__main__":
    widget = HtmlInfoDisplay()
    html_view.height = .3
    html_view.width = .3
    widget.edit_traits(view=html_view)
Beispiel #6
0
        else:
            self._html = rest_html.convert_function_info(
                func.name, func.doc_string)

    def set_text(self, text):
        """ Display a message in the help window.

            The text message is wrapped in html tags so that it displays
            correctly in the html window.
        """
        self._html = self._htmlify(text)

    def set_html(self, html):
        """ Display html text without modification into the window.
        """
        self._html = html

    ### private methods ######################################################

    def _htmlify(self, text):
        """ Add <html> and <body> tags around text so that it is valid html.
        """
        return "<html>\n<body>\n%s\n</body>\n</html>" % text


if __name__ == "__main__":
    widget = HtmlInfoDisplay()
    html_view.height = .3
    html_view.width = .3
    widget.edit_traits(view=html_view)