[pygtk] ScrolledWindow & TextView Problem.
Neil Dugan
pygtk at butterflystitches.com.au
Sun Sep 14 18:40:01 WST 2008
Dominic Salemno wrote:
> Greetings,
>
> Here resides my issue! I have a ScrolledWindow being utilized inside my
> application. Contained inside of the ScrolledWindow is a TextView widget.
> Last, but certainly not least, is a TextBuffer associated with the TextView
> widget. Simple... correct? I thought as much! The main purpose of the
> application is to provide a scrolling effect anytime new text is inserted.
> The window would start scrolling downwards in the event the text started
> scrolling outside the viewable area. I implemented this technique inside the
> pygtk FAQ:
>
> http://faq.pygtk.org/index.py?req=show&file=faq14.010.htp
>
> The technique is basically explained as so (copied from the entry):
>
> end_iter = text_buffer.get_end_iter()
> text_buffer.insert(end_iter, text)
> text_view.scroll_to_mark(text_buffer.get_insert(), 0)
>
> This works fine until one touches the viewable area in where the text
> resides. The TextView properities are as follows:
>
> set_editable(False)
> set_cursor_visible(False)
>
> Therefore, no one is actually editing anything inside this area. I was
> simply trying to copy text that is populating the area and paste it into
> another application. As soon as I try this... new text still begins to
> populate the area. The scrolling effect just instantly stops working!
>
> This effect is an absolute necessity for this type of application!
>
> Suggestions?
>
> Thank you!
>
> Sincerely, Dominic Salemno.
>
>
Hi,
I don't know how to fix you exact problem. But in a similar case,
when adding an item to a gtk.HBox() inside a scrolledwindow, I used this
adj = self.scrolled_window.get_vadjustment()
adj.set_value(adj.upper)
Regards Neil.
More information about the pygtk
mailing list