After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 103616 - "data" argument to bitmap_create_from_data should have type const-guchar*
"data" argument to bitmap_create_from_data should have type const-guchar*
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: general
1.99.x/2.0.x
Other All
: Normal normal
: ---
Assigned To: Python bindings maintainers
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2003-01-16 00:33 UTC by kohler
Modified: 2007-05-15 09:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kohler 2003-01-16 00:33:44 UTC
The "data" argument of bitmap_create_from_data() (corresponding to
gdk_bitmap_create_from_data()) is not a C string, but a "width"x"height"
array of bits. This array may contain NUL characters, for example. The type
"const-gchar*" is therefore inappropriate, since the generated Python
raises an exception if string arguments with type "gchar*" or
"const-gchar*" have embedded NULs. I think the right type is
"const-guchar*", which behaves like "const-gchar*" but allows embedded
NULs. Same goes for pixmap_create_from_data().

Note that the GDK functions take "const char *" arguments, which is
presumably why "const-gchar*" was chosen in the first place; but unlike
most "const char *"s, these are not C strings.

I'd like this bug to be fixed some way or other so that I can create custom
cursors within PyGTK. Custom cursors = bitmaps = bitmap_create_from_data().

Eddie


Index: gtk/gdk.defs
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gtk/gdk.defs,v
retrieving revision 1.44
diff -u -r1.44 gdk.defs
--- gtk/gdk.defs	28 Dec 2002 14:11:23 -0000	1.44
+++ gtk/gdk.defs	16 Jan 2003 00:27:09 -0000
@@ -1653,7 +1653,7 @@
   (return-type "GdkBitmap*")
   (parameters
     '("GdkWindow*" "window")
-    '("const-gchar*" "data")
+    '("const-guchar*" "data")
     '("gint" "width")
     '("gint" "height")
   )
@@ -1664,7 +1664,7 @@
   (return-type "GdkPixmap*")
   (parameters
     '("GdkWindow*" "window")
-    '("const-gchar*" "data")
+    '("const-guchar*" "data")
     '("gint" "width")
     '("gint" "height")
     '("gint" "depth")
Comment 1 Johan (not receiving bugmail) Dahlin 2003-01-18 17:27:20 UTC
Thanks.

Fixed in CVS.
Comment 2 Pádraig Brady 2007-05-15 09:37:15 UTC
Note this bug was introduced again for pygtk-2.8.[12]
as reported again in bug number 318874
Unfortunately ubuntu breezy was released with pygtk-2.8.1