[pygtk] ScrolledWindow & TextView Problem.
Dominic Salemno
d.salemno at gmail.com
Sat Sep 20 00:35:45 WST 2008
Thanks Neil,
I will try this out!
But what is of a concern to me is that the method I described is the
commonly accepted solution and as so, is provided within the FAQ. I
can't be the only one having this particular issue. Perhaps it is the
combination of a ScrolledWindow and TextView... Can anyone verify the
problem I describe?
This was both an issue whether I was running Gnome and XFCE. I did not
try it on another platform such as Mac OS X or Windows.
Sincerely, Dominic Salemno.
On Sun, Sep 14, 2008 at 6:40 AM, Neil Dugan
<pygtk at butterflystitches.com.au> wrote:
> 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