[Java-gnome-developer] Patch for Pixbuf
Brought to you by:
afcowie
From: Destrius <des...@th...> - 2003-01-29 16:38:19
|
Greetings, I have only been looking at Java-Gnome for about 2 weeks or so, so I apologize if I make any obvious mistakes. Anyway, I've made some modifications to the src/java/org/gnu/gdk/Pixbuf.java file to add in support for creating pixbufs from images, retrieving the width and height of the image, and a simple scale function. Nothing really special, but I'll work on tackling the rest of the functions if nobody else will; I have a need for them as I'm working on a graphical application in Java-Gnome. The diff is attached; apply to Pixbuf.java. On a similar note, I've been going through some of the previous posts regarding TreeView and the displaying of Pixbufs; I have the same problem, and after going through the code I think its something to do with the GValue used to store the Pixbuf's handle (pointer). When running a simple program using ListStore to create a list of images, I get these messages: (java-gnome:9913): GLib-GObject-CRITICAL **: file gvaluetypes.c: line 803 (g_value_get_pointer): assertion `G_VALUE_HOLDS_POINTER (value)' failed (java-gnome:9913): GLib-GObject-WARNING **: unable to set property `pixbuf' of type `GdkPixbuf' from value of type `gpointer' I can't really be sure, but my guess is that somewhere down the line the pointers get messed up and so the original GdkPixbuf can no longer be referenced. The main problem is that I haven't managed to pinpoint where the second message is originating from. It could just as well be a problem with my current configuration, as for some reason Sun's java refuses to run java-gnome programs without crashing everytime an event occurs. I'm using kaffe instead, and it runs fine. Programs are still compiled using the Sun JDK (j2se1.4), and jikes works as well. I'd appreciate if anybody has working code that displays a set of pixbufs in a list, something like a thumbnail browser. This functionality is integral to the program I'm writing, so I really need to get it working, even if it involves several hours of staring at the gtk+ sources. :P -- Destrius http://harmos.threeone.net |