Alif Wahid wrote:

Hi,

I'm one of the developers of GtkGLExt library on sourceforge, and we're providing a python binding to GtkGLExt (an OpenGL capability extension of Gtk). In the process of writing test programs we've come across a minor discrepancy between the Python binding of Pango and its C API.

You see in Pango some functions are passed a NULL pointer to specify default behaviour. This doesn't seem to be the case in the Python binding, in other words we can't pass a None type object to achieve the same feat without generating unnecessary exceptions about the wrong type. In particular the method get_metrics(...) of a pango.Font derivative doesn't accept the None object and spews up a TypeError exception instead. On the other hand in the C API passing a NULL pointer to the same function simply means to do the default thing (that is to load metrics for the entire font, not language dependent). So as you can see Python binding should follow the same sort of Pango API conventions.

I think it shouldn't be that difficult since as far as I and the other developer of GtkGLExt, Naofumi Yasufuku, can see all that's needed is to add '(null-ok) (default "NULL")' in the argument specifications of the corresponding functions in pango.def file. We haven't tried this however, so we can be misleading.

Anyway, keep up the great work with PyGtk. Cheers.


Thanks for looking into this. Could you submit bugzilla reports for the cases where NULL arguments should be accepted but aren't? Go to http://bugzilla.gnome.org/ and file the bug reports. Use the "gnome-python" product for the bug reports.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



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

Reply via email to