<br><font size=2 face="sans-serif">Hi. <br>
</font>
<br><font size=2 face="sans-serif">This is kind of a cross-product question,
having to do with accessibility on Linux using ATK (AT-SPI).</font>
<br><font size=2 face="sans-serif">However, I think it really boils down
to a python question: "How do I pass an integer by reference to a
C function?"</font>
<br><font size=2 face="sans-serif"><br>
I am using Accerciser (</font><a href=http://live.gnome.org/Accerciser><font size=2 face="sans-serif">http://live.gnome.org/Accerciser</font></a><font size=2 face="sans-serif">),
an accessibility testing tool that has an ipython console.</font>
<br><font size=2 face="sans-serif">It uses pyatspi to interact with AT-SPI
through pyORBit.</font>
<br>
<br><font size=2 face="sans-serif">I need to test my handling of atk_editable_text_insert_text(AtkEditableText
*text, const gchar *string, gint length, gint *position). </font>
<br><font size=2 face="sans-serif">In the example below, the variable 'acc'
has been bound (by Accerciser) to an accessible object that implements
the AtkEditableText  interface.<br>
<br>
The problem is that the pesky "position" parameter wants a pointer
to an integer.<br>
<br>
I have tried all sorts of ways to get Accerciser's iPython console to accept
the last parameter, but I always get: "TypeError: could not marshal
arg 'position'." </font>
<br>
<br><font size=2 face="sans-serif">Has anyone done this? If so, then how
is it done?<br>
<br>
Here's a sample of the things I tried: <br>
<br>
</font><tt><font size=2>In [1]: t=acc.queryEditableText() <br>
In [2]: t.getText(0,45) <br>
Out[2]: 'The quick brown fox jumps over the lazy dog.\n' <br>
In [3]: t.deleteText(10,15) <br>
Out[3]: True <br>
In [4]: t.getText(0,40) <br>
Out[4]: 'The quick  fox jumps over the lazy dog.\n' <br>
In [5]: pos=10 <br>
In [6]: t.insertText("brown",5,pos) <br>
---------------------------------------------------------------------------
<br>
TypeError                  
              Traceback (most recent
call last) <br>
<br>
/usr/lib/python2.6/dist-packages/pyatspi/__init__.pyc in <module>()
<br>
----> 1 <br>
      2 <br>
      3 <br>
      4 <br>
      5 <br>
<br>
/usr/lib/python2.6/dist-packages/pyatspi/accessible.pyc in _inner(self,
*args, **kwargs) <br>
    230     try: <br>
    231       # try calling the original func
<br>
<br>
--> 232       return func(self, *args, **kwargs) <br>
    233     except ORBit.CORBA.NO_IMPLEMENT, e: <br>
    234       # raise Python exception <br>
<br>
TypeError: could not marshal arg 'position' <br>
<br>
In [7]: t.insertText("brown",5,id(pos)) <br>
---------------------------------------------------------------------------
<br>
TypeError                  
              Traceback (most recent
call last) <br>
<br>
/usr/lib/python2.6/dist-packages/pyatspi/__init__.pyc in <module>()
<br>
----> 1 <br>
      2 <br>
      3 <br>
      4 <br>
      5 <br>
<br>
/usr/lib/python2.6/dist-packages/pyatspi/accessible.pyc in _inner(self,
*args, **kwargs) <br>
    230     try: <br>
    231       # try calling the original func
<br>
<br>
--> 232       return func(self, *args, **kwargs) <br>
    233     except ORBit.CORBA.NO_IMPLEMENT, e: <br>
    234       # raise Python exception <br>
<br>
TypeError: could not marshal arg 'position' <br>
<br>
In [8]: pos=[10] <br>
In [9]: t.insertText("brown",5,pos) <br>
---------------------------------------------------------------------------
<br>
TypeError                  
              Traceback (most recent
call last) <br>
<br>
/usr/lib/python2.6/dist-packages/pyatspi/__init__.pyc in <module>()
<br>
----> 1 <br>
      2 <br>
      3 <br>
      4 <br>
      5 <br>
<br>
/usr/lib/python2.6/dist-packages/pyatspi/accessible.pyc in _inner(self,
*args, **kwargs) <br>
    230     try: <br>
    231       # try calling the original func
<br>
<br>
--> 232       return func(self, *args, **kwargs) <br>
    233     except ORBit.CORBA.NO_IMPLEMENT, e: <br>
    234       # raise Python exception <br>
<br>
TypeError: could not marshal arg 'position' <br>
<br>
In [7]: pos=array([10]) <br>
---------------------------------------------------------------------------
<br>
NameError                  
              Traceback (most recent
call last) <br>
<br>
/usr/lib/python2.6/dist-packages/pyatspi/__init__.pyc in <module>()
<br>
----> 1 <br>
      2 <br>
      3 <br>
      4 <br>
      5 <br>
<br>
NameError: name 'array' is not defined <br>
</font></tt><font size=2 face="sans-serif"><br>
Thanks, <br>
Carolyn</font>