Re: [pygtk] unicode error

2005-02-08 Thread Brian
On Wed, 2005-09-02 at 16:03 +0900, Guillaume Proux wrote:
> Hi Brian,
> 
> Not sure I am barking the right tree, but I am pretty sure that Python 
> can be compiled to represent unicode object either with UCS2 or UCS4.
> Check that out: http://python.fyxm.net/doc/FAQ.html#id182
> Ah the joy of the "i compile all myself distribs" ;)
> 
> G
> 
Thanks.   There was a security update to python just released.  It looks
like a pygtk re-install should fix the unicode mismatch.

> Brian wrote:
> 
> >One of the users of our program is having a problem.
> >
> >ordinateur gnoniqoz # porthole 
> >pycrash module not found.  For best debug info Please emerge >=
> >dev-python/pycrash-0.4pre2 
> >Traceback (most recent call last): 
> >  File "/usr/bin/porthole", line 59, in ? 
> >import gtk, time 
> >  File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line
> >33, in ? 
> >import gobject as _gobject 
> >ImportError: /usr/lib/python2.3/site-packages/gtk-2.0/gobject.so:
> >undefined symbol: PyUnicodeUCS4_AsUnicode
> >
> >I know that any previous problems with gtk have turned out to be
> >permissions not set correctly.
> >
> >Any ideas what to look for?
> >
> >Thank you.
> >  
> >
> 
> 
-- 
Brian <[EMAIL PROTECTED]>

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


Re: [pygtk] unicode error

2005-02-08 Thread Guillaume Proux
Hi Brian,
Not sure I am barking the right tree, but I am pretty sure that Python 
can be compiled to represent unicode object either with UCS2 or UCS4.
Check that out: http://python.fyxm.net/doc/FAQ.html#id182
Ah the joy of the "i compile all myself distribs" ;)

G
Brian wrote:
One of the users of our program is having a problem.
ordinateur gnoniqoz # porthole 
pycrash module not found.  For best debug info Please emerge >=
dev-python/pycrash-0.4pre2 
Traceback (most recent call last): 
 File "/usr/bin/porthole", line 59, in ? 
   import gtk, time 
 File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line
33, in ? 
   import gobject as _gobject 
ImportError: /usr/lib/python2.3/site-packages/gtk-2.0/gobject.so:
undefined symbol: PyUnicodeUCS4_AsUnicode

I know that any previous problems with gtk have turned out to be
permissions not set correctly.
Any ideas what to look for?
Thank you.
 


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


[pygtk] unicode error

2005-02-08 Thread Brian
One of the users of our program is having a problem.

ordinateur gnoniqoz # porthole 
pycrash module not found.  For best debug info Please emerge >=
dev-python/pycrash-0.4pre2 
Traceback (most recent call last): 
  File "/usr/bin/porthole", line 59, in ? 
import gtk, time 
  File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line
33, in ? 
import gobject as _gobject 
ImportError: /usr/lib/python2.3/site-packages/gtk-2.0/gobject.so:
undefined symbol: PyUnicodeUCS4_AsUnicode

I know that any previous problems with gtk have turned out to be
permissions not set correctly.

Any ideas what to look for?

Thank you.
-- 
Brian <[EMAIL PROTECTED]>

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


[pygtk] Embedding pygtk from C

2005-02-08 Thread Stephane Raimbault
Hi,

I found some informations about extending pygtk in C (pygtk mailing
list) but I don't know how to create a GTK object with pygtk and pack
this object in C application.

I try something, it doesn't work but it give a good idea of what I want
to do :

/* 

gcc try-embedding-pygtk.c -o try-embedding-pygtk -
I/usr/include/python2.3 -L/usr/lib/python2.3/config/ -lpython2.3  -
lpthread -lutil `pkg-config --libs --cflags glib-2.0 gthread-2.0 gtk
+-2.0 pygtk-2.0`

*/

#include 
#include 
#include 
#include 

PyTypeObject *PyGObject_Type = NULL;

int main(int argc, char **argv)
{
GtkWidget *w;
GtkWidget *b;
PyObject *args;
PyObject *pmod, *pdict;
PyGObject *py_widget;

gtk_init(&argc, &argv);
Py_Initialize();

w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(w, 
 "destroy",
 G_CALLBACK(gtk_main_quit), 
 NULL);

PyRun_SimpleString("import sys");
PyRun_SimpleString("sys.path.insert(0, '')");
PyRun_SimpleString("import gtk");
args = PyRun_String("gtk.Button('Test')",
Py_single_input, NULL, NULL);

/* Works better with :
   def create_button():
   return gtk.Button('Test')
*/
g_debug("Args %x", args);

/* I want to retrieve GTK button pointer */
PyArg_ParseTuple(args, "O!", PyGObject_Type, &py_widget);
b = GTK_WIDGET((PyGObject *)py_widget->obj);

g_debug("Args->obj %x", b);

gtk_container_add(GTK_CONTAINER(w), b);
gtk_widget_show_all(w);

gtk_main();

Py_Finalize();

return 0;
}

Thank you for your help.

Stephane


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


Re: [pygtk] FW: Gtk / PyGtk crashing python interpreter

2005-02-08 Thread Le Boulanger Yann
I'm sorry my message was not for this thread.
I send it once again in the good one (gtk with glade. Can't use more 
then one window...)

Sorry for the noise
Yann
Leeuw van der, Tim wrote:
Hi Yann,
There's no Glade involved in it (yet) and no callbacks... The bug happens when 
retrieving doc-strings for code completion.
This particular bug also has been fixed, but now another bug surfaced with the 
same routine (slightly extended from the example below).
See http://bugzilla.gnome.org/show_bug.cgi?id=166546
[...]



signature.asc
Description: OpenPGP digital signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/