pixmaps...
- From: James A <jamesa demon net>
- To: gtk-list redhat com
- Subject: pixmaps...
- Date: 07 Oct 1997 21:41:48 +0100
I'm pretty new to gtk, I've had a look at the info files and when
that wasn't enough (most of the time :) read testgtk.c and other bits
of source.
Anyway I was trying to find a way to get xpm's loaded using the
pixmap_path but I could only find gdk_pixmap_create_from_xpm which
needs a full path name. Something like gtk_rc_pixmap_in_path would be
useful I've looked in gdkpixmap.c so I'm guessing that it isn't
available yet ?
While looking I found 2 possible problems.
1) do we know that all data being passed to gdk_pixmap_seek_string
will have line counts less than 1023 ? If not there is an overflow
there, all we need to do is change the %s to %1023s
2) Every time an entry in the pixmap_path is found the entire path
string is free'd and malloc'd again for no apparant reason, it's
free'd at function exit anyway and the 0's aren't used before then. So
here's a patch.
--- gtkrc.c Tue Oct 7 20:27:53 1997
+++ gtkrc.c Tue Oct 7 20:55:10 1997
@@ -1287,8 +1287,6 @@
path_num++;
pixmap_path[path_num] = NULL;
start_offset = end_offset + 1;
- g_free(buf);
- buf = g_strdup(pix_path);
}
}
g_free(buf);
--
/* James Antill ** http://www.and.org/ */ main(){int h[3][3]=
{{44680,57949,51424},{60552,41941,18576},{44782,57757,12000}};
int i=-1,j;while(i++<2){j^=j;while(j<3){int k=16;while(--k>=0)
putchar(h[i][j]&(1<<k)?'x':' ');++j;}putchar('\n');}exit(0);}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]