Esempio n. 1
0
File: textview.py Progetto: jpzm/bw
    def bw_set_text(self, text, f_before_scroll=None):
        """
        """
        if text != "":

            count = text.count('\n') + text.count('\r')

            lines = range(1, count + 2)
            lines = [str(i).strip() for i in lines]

            self.__textbuffer.set_text(text)
            self.__linebuffer.set_text('\n'.join(lines))

            if self.__scroll:

                if f_before_scroll:
                    f_before_scroll()

                update_gui()

                value  = self.get_vadjustment().upper
                value -= self.get_vadjustment().page_size

                self.get_vadjustment().set_value(value)

        else:

            self.__textbuffer.set_text("")
            self.__linebuffer.set_text("")
Esempio n. 2
0
    def bw_set_text(self, text, f_before_scroll=None):
        """
        """
        if text != "":

            count = text.count('\n') + text.count('\r')

            lines = range(1, count + 2)
            lines = [str(i).strip() for i in lines]

            self.__textbuffer.set_text(text)
            self.__linebuffer.set_text('\n'.join(lines))

            if self.__scroll:

                if f_before_scroll:
                    f_before_scroll()

                update_gui()

                value = self.get_vadjustment().upper
                value -= self.get_vadjustment().page_size

                self.get_vadjustment().set_value(value)

        else:

            self.__textbuffer.set_text("")
            self.__linebuffer.set_text("")
Esempio n. 3
0
File: textview.py Progetto: jpzm/bw
    def bw_set_text(self, text, f_before_scroll=None):
        """
        """
        self.__textbuffer.set_text(text)

        if self.__scroll:

            if f_before_scroll:
                f_before_scroll()

            update_gui()

            value  = self.get_vadjustment().upper
            value -= self.get_vadjustment().page_size

            self.get_vadjustment().set_value(value)
Esempio n. 4
0
    def bw_set_text(self, text, f_before_scroll=None):
        """
        """
        self.__textbuffer.set_text(text)

        if self.__scroll:

            if f_before_scroll:
                f_before_scroll()

            update_gui()

            value = self.get_vadjustment().upper
            value -= self.get_vadjustment().page_size

            self.get_vadjustment().set_value(value)