Re: [pygtk] TextView / TextBuffer autoscroll to end

2003-09-08 Thread Mikoyan
On Sun, 2003-09-07 at 18:44, Martin Preishuber wrote:
 Hi all,
 
 I tried to solve the following small problem for the 3rd time now and
 didn't find a solution, so I thought I'd ask here :) The problem is the
 following:
 
 I have a ScrolledWindow containing a TextView widget with a TextBuffer.
 I insert text into the TextBuffer with .insert_at_cursor(text). Now that
 works fine, except that the visible lines are always the first few
 lines, so it doesn't scroll down automatically. 
 How do I automatically scroll down to the latest line ? I played around
 with TextView.place_cursor_on_screen(), scroll_iter() and co but with no
 success :( Any ideas ?

The next C code inserts text at the end and then scrolls down to the
end.

gtk_text_buffer_get_end_iter(buffer, end_iter);
gtk_text_buffer_insert(buffer, end_iter, line-str, line-len);
gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(textview),
gtk_text_buffer_get_insert(buffer), 0.0, TRUE, 0.5, 0.5);

So, in python you could do probably something like :

textbuffer.scroll_to_mark(textbuffer.get_insert(), 0);

Too lazy to look up ;-). Hope it helps.

 Thanks,
 
 Martin

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] TextView / TextBuffer autoscroll to end

2003-09-08 Thread Gustavo J. A. M. Carneiro
A Dom, 2003-09-07 às 17:44, Martin Preishuber escreveu:
 Hi all,
 
 I tried to solve the following small problem for the 3rd time now and
 didn't find a solution, so I thought I'd ask here :) The problem is the
 following:
 
 I have a ScrolledWindow containing a TextView widget with a TextBuffer.
 I insert text into the TextBuffer with .insert_at_cursor(text). Now that
 works fine, except that the visible lines are always the first few
 lines, so it doesn't scroll down automatically. 
 How do I automatically scroll down to the latest line ? I played around
 with TextView.place_cursor_on_screen(), scroll_iter() and co but with no
 success :( Any ideas ?

  I have this old code from my project:

void console_view_scroll_to_bottom(ConsoleView *self)
{
GtkTextBuffer *textbuf;
GtkTextMark *end_mark;
textbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(self-text_view));
end_mark = gtk_text_buffer_get_mark(textbuf, end-of-buffer);
gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(self-text_view), end_mark,
 0, TRUE, 0.0, 1.0);
}

  Now, translate that to Python. :)

 
 Thanks,
 
 Martin
-- 
Gustavo João Alves Marques Carneiro
[EMAIL PROTECTED] [EMAIL PROTECTED]


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] TextView / TextBuffer autoscroll to end

2003-09-08 Thread Christian Reis
On Mon, Sep 08, 2003 at 02:05:13PM +0100, Gustavo J. A. M. Carneiro wrote:
 void console_view_scroll_to_bottom(ConsoleView *self)
 {
 GtkTextBuffer *textbuf;
 GtkTextMark *end_mark;
 textbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(self-text_view));
 end_mark = gtk_text_buffer_get_mark(textbuf, end-of-buffer);
 gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(self-text_view), end_mark,
0, TRUE, 0.0, 1.0);
 }

Scary. - FAQ 14.10

http://www.async.com.br/faq/pygtk/index.py?req=showfile=faq14.010.htp

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Warnings issued by get_property

2003-09-08 Thread Christian Reis
On Fri, Sep 05, 2003 at 11:57:22AM +0800, James Henstridge wrote:
 On 4/09/2003 8:00 AM, Michael McLay wrote:
 
 I received an odd warning when testing the use of get_property. Accessing 
 the 'child' property for a button returns the message:
 
 (:2640): Gtk-WARNING **: ../../gtk/gtkcontainer.c:874: invalid property id 
 3 for child of type `GParamObject' in `GtkButton'
  
 
 c.get_property('child')

 
 
 (:2640): Gtk-WARNING **: ../../gtk/gtkcontainer.c:874: invalid property id 
 3 for child of type `GParamObject' in `GtkButton'
 
 Here's the code that caused this to happen.
  
 
 the GtkContainer::child property is write-only, which is why you get 
 weird results when trying to read it.  The other cases are most likely 
 similar.

Would it be possible to raise a proper exception in this case explaining
it is write-only?

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] [2.0.0] gtk/gtktreeview.override patch

2003-09-08 Thread Christian Reis
On Thu, Sep 04, 2003 at 01:08:52PM -0500, Albert Chin wrote:
 C++ comments invalid for C89 code.

If you have CVS access, feel free to check this in

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] Cant get gnome-python bonobo module to work

2003-09-08 Thread Christian Reis
On Mon, Sep 08, 2003 at 07:58:39PM -0500, Nick Hudson wrote:
 [EMAIL PROTECTED] /usr/lib/python2.3/site-packages # python
 Python 2.3 (#1, Aug  3 2003, 02:10:05)
 [GCC 3.2.3] on linux2
 Type help, copyright, credits or license for more information.
  import bonobo.ui
 Traceback (most recent call last):
   File stdin, line 1, in ?
   File /usr/lib/python2.3/site-packages/gtk-2.0/bonobo/__init__.py,
 line 7, in ?
 ORBit.load_typelib('Bonobo')
 RuntimeError: could not load typelib

This seems to be the best indication of the real problem here, and
google knows it:

http://www.daa.com.au/pipermail/pygtk/2003-March/004618.html

Summary: as James has posted before, IF you use Redhat 8, you need
an updated RH8 RPM for libbonobo.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/