Re: [NEWBIE] GdkPixbuf loading problem
- From: Michael Hill <mjh rdasys com>
- To: Andrej Kacian <tichowrl centrum sk>
- Cc: gtk-list gnome org
- Subject: Re: [NEWBIE] GdkPixbuf loading problem
- Date: 30 Jan 2003 15:45:14 -0500
On Thu, 2003-01-30 at 15:03, Andrej Kacian wrote:
Hi world,
I have a problem loading pixbufs using gdk_pixbuf_new_from_file()
function. Following code results in segmentation fault:
/* begin */
char buf[64];
GdkPixbuf *p;
GError **err;
strcpy(buf, "/tmp/image.png");
p = gdk_pixbuf_new_from_file(buf, err);
You should be passing a pointer or buf[] by reference as the file name (i.e) gdk_pixbuf_new_from_file(&buf, err);
Cheers,
Michael
/* end of code */
On the contrary, following code works right as rain:
/* begin */
GdkPixbuf *p;
GError **err;
p = \
gdk_pixbuf_new_from_file(gtk_file_selection_get_filename(GTK_FILE_SELECTION(fsel),\ err);
/* end of code */
I think I have messed up some of the variable and return values types,
but I can't seem to solve it by myself.
Can anybody help/flame me about what am I doing wrong, please?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]