Ejemplo n.º 1
0
    def open_textbox(self, screen, text):
        from plasma.lib.ui.inlineed import InlineEd
        (h, w) = screen.getmaxyx()

        ed = InlineEd(self, h, w, 0, 0, 0, text, 0, [])

        # TODO: fix self.cursor_x >= w
        self.cursor_x = len(text)
        if self.cursor_x >= w:
            self.cursor_x = w - 1

        ed.print_curr_line = False
        ret = ed.start_view(screen)
        if not ret:
            return ""
        return ed.text