Re: [pygtk] gpointer in editable.connect("insert_text", self.insert)

2003-07-17 Thread Christian Reis
On Tue, Jul 15, 2003 at 04:02:04PM +0200, Thomas Hunger wrote:
> void
> insert_text_handler (GtkEditable *editable,
>  const gchar *text,
>  gint length,
>  gint*position,
>  gpointer data)
> 
> When I do this in python, the position argument is (print position):
> 

I thought it was a bug; I would expect it should be an int. However, in
PyGTK 0.6:

>>> t = gtk.GtkText()
>>> t.set_editable(1)
>>> def foo(*args):
...   print args
... 
>>> t.connect("insert_text", foo)
10

When I keypress, I get back the following tuple:

(
,
'a\x8a\x13\x08G"[EMAIL PROTECTED]/@[EMAIL PROTECTED]/@[EMAIL 
PROTECTED]/@[EMAIL PROTECTED]',
1, 

)

Which is (widget, text, length, something) (no data is provided because
I didn't connect with data). Ignore the bizarre text buffer, and you
have the same sort of weird return value that you are getting. James?

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/


[pygtk] gpointer in editable.connect("insert_text", self.insert)

2003-07-16 Thread Thomas Hunger
Hi,
I want to connect to the insert_text signal of the editable. My GTK2+docs say:

void
insert_text_handler (GtkEditable *editable,
 const gchar *text,
 gint length,
 gint*position,
 gpointer data)

When I do this in python, the position argument is (print position):


How can I retrieve the actual integer value behind this pointer in python?

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