Re: [gtk-list] pixmaps...
- From: Ian Main <slow intergate bc ca>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] pixmaps...
- Date: Tue, 7 Oct 1997 18:06:23 -0700 (PDT)
On 7 Oct 1997, James A wrote:
> 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.
You may want to look at the tutorial, if you haven't found it already:
> 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 ?
The pixmap path was only implemented to allow the tiled pixmaps specified
in the gtkrc to be found. It's not carried into the application,
although, it's an interesting idea.. What do others think ? Should the
gdk pixmap loading functions search the pixmap path ?
> 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
Mmm.. yeah. It was a bit of a hack I admit :)
> 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.
Hmm.. OK, I'll look at it later (I'm at work right now) just to see what I
was thinking, and see if it can be improved.
"Simplicity is achieved by the elimination of special cases, such as the
discrimination between devices and files."
- Brian Kernighan and John Mashey.
] [Thread Prev