Re: [gtk-list] Re: Problem adding GdkRgb
- From: "D. Jackson Peacock" <pavon gallup net>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Problem adding GdkRgb
- Date: Mon, 10 May 1999 11:57:42 -0600 (MDT)
I'm doing something simular and can't figure out why i keep getting core
dumps. heres the code where i set up the rgb buffer and then try to draw
it. It dumps core in gdk_draw_rgb_image;
/* Backing rgb image for drawing area */
static guchar *buff = NULL;
static int buff_width;
static int buff_height;
static int buff_size; /* = width * height * 3 */
static int buff_rowstride; /* rowstride: width * 3 */
/* Create a new backing rgb image of the appropriate size */
static gint configure_event (GtkWidget *widget, GdkEventConfigure *event){
buff_width = widget->allocation.width;
buff_height = widget->allocation.height;
buff_size = buff_width * buff_height * 3;
buff_rowstride = buff_width * 3;
if (buff)
free (buff);
buff = (guchar *) malloc (buff_size);
memset(buff, (guchar)0, buff_size); /* set the image to all black */
return TRUE;
}
/* Redraw the screen from the backing rgb image */
static gint expose_event (GtkWidget *widget, GdkEventExpose *event){
gdk_draw_rgb_image (widget->window,
widget->style->fg_gc[GTK_STATE_NORMAL],
0,0, buff_width, buff_height,
GDK_RGB_DITHER_NONE, buff, buff_rowstride);
return FALSE;
}
_______
#********************# / _____ \
# D. Jackson Peacock # / /_____\ \
# pavon@gallup.net # |___ __ |
# ICQ 25755468 # | |_/ /
# PO Box 2102 # | __/
# Socorro, NM 87801 # --__/ /
#********************# \____/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]