Re: [Java-gnome-developer] Having problem with IconTheme
Brought to you by:
afcowie
From: Ismael J. <ml...@ju...> - 2005-03-07 08:47:38
|
Manuel Ledesma wrote: > Here is my code ... > > IconTheme theme = IconTheme.getDefault(); > Pixbuf icon = theme.loadIcon("gnome-fs-directory", 16, > IconLookupFlags.USE_BUILTIN); > > Here is the exception that I'm always getting: > java.lang.Exception: file gtkicontheme.c: line 1244 > (gtk_icon_theme_load_icon): assertion `error == NULL || *error == NULL' > failed > at org.gnu.glib.GObject.printStackTrace(GObject.java:644) > at org.gnu.gtk.IconTheme.gtk_icon_theme_load_icon(Native Method) > at org.gnu.gtk.IconTheme.loadIcon(IconTheme.java:70) > at org.mels.TreeHelper.addRow(TreeHelper.java:128) > at org.mels.TreeHelper.getTree(TreeHelper.java:79) > at org.mels.GCvs.createTree(GCvs.java:68) > at org.mels.GCvs.<init>(GCvs.java:52) > at org.mels.GCvs.main(GCvs.java:116) > > (java-gnome:10069): GLib-GObject-CRITICAL **: file gobject.c: line 1667 > (g_object_set_data_full): assertion `G_IS_OBJECT (object)' failed > > Any help or suggestion would be greatly appreciated. > > Thanks in advance. > Hi, I had a quick look and it seems like it is a bug in libgtk-java. In IconTheme.java, the native method gtk_icon_theme_load_icon has one incorrect parameter. The signature should be gtk_icon_theme_load_icon(Handle, String, int, int, Handle), but it is gtk_icon_theme_load_icon(Handle, String, int, int, int[]). In addition there is also a problem with loadIcon(String, int, IconLookupFlags). It calls the Pixbuf constructor without checking if the Handle received from gtk_icon_theme_load_icon is null. However, according to the javadoc for GTK, null is returned if no icon is found. Anyways, I am not very familiar with the java-gnome codebase, so I might be wrong. :) Regards, Ismael |