Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 27363

Summary: pygtk : GtkTextBuffer.insert_at_cursor() doesn't follow pygtk API
Product: Gentoo Linux Reporter: Philippe Lafoucrière <lafou>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: 1.4   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Philippe Lafoucrière 2003-08-26 08:21:35 UTC
Running an exemple of pygtk causes some trouble. I wanted to try this tutorial
http://www.linuxjournal.com/article.php?sid=6586, but have the following error :

Traceback (most recent call last):
  File "./serverinfo.py", line 65, in button1_clicked
    self.logwindow.insert_at_cursor(data,len(data))
TypeError: GtkTextBuffer.insert_at_cursor() takes exactly 1 argument (2 given)

In the pygtk API, insert_at_cursor takes 2 args.
please see
http://www.gnome.org/~james/pygtk-docs/class-gtktextbuffer.html#method-gtktextbuffer--insert-at-cursor


Reproducible: Always
Steps to Reproduce:
1. Try launch attached file
2.
3.

Actual Results:  
Traceback (most recent call last):
  File "./serverinfo.py", line 65, in button1_clicked
    self.logwindow.insert_at_cursor(data,len(data))
TypeError: GtkTextBuffer.insert_at_cursor() takes exactly 1 argument (2 given)

Expected Results:  
text output in TextView1

I don't know weather if it's a gentoo related bug. Maybe a pygtk version error.
Comment 1 Alastair Tse (RETIRED) gentoo-dev 2003-08-30 19:40:55 UTC
you don't say which version of pygtk you are using and also which version of gtk.
Comment 2 Rob Cakebread (RETIRED) gentoo-dev 2003-09-09 16:05:36 UTC
The syntax has changed between versions of pyGTK

If you look at the finished demo code here:
ftp://ftp.ssc.com/pub/lj/listings/issue113/6586.tgz

you'll see they use:

    try:
	#this changed in a revision of pyGTK2
        self.logwindow.insert_at_cursor(data,len(data))
    except:
	self.logwindow.insert_at_cursor(data)
Comment 3 Rob Cakebread (RETIRED) gentoo-dev 2003-10-04 22:30:06 UTC
Closing as it is a matter of syntax between GTK+1 and GTK+2. See my above
comment.