GdkPixmap and configure_event



Hi,
I am working on a project in which we are trying to
upgrade its old GUI based on x lib pure calls to GTK
(gtk-1.2).
The problem is that I am creating a gtk drawing area
which is used for drawing with x calls drawing
functions. Things are working fine,except for
GdkPixmap. It seems that for some reasons, using
configure event with gdkpixmap doesnt work! The expose
event works perfect,but when it tries to configure
only a black area appears after the configure event is
fired. Here is the code:

gint expose_event (GtkWidget *widget, GdkEventExpose
*event, gpointer data)
{
//HWindow is a struct that has a GdkPixmap as a
member.
HWindow *win = (HWindow*) data;

//widget is the drawing area

gdk_draw_pixmap (widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
win->pixmap,
event->area.x,event->area.y,
event->area.x,event->area.y,
event->area.width,event->area.height);

return FALSE;
}

gint config_event (GtkWidget *widget,GdkEventConfigure
*event, gpointer data)
{
HWindow *win= (Hwindow*)data;
if (win->pixmap)
	gdk_pixmap_unref(win->pixmap);

win->pixmap = gdk_pixmap_new(widget->window,
	widget->allocation.width,
	widget->allocation.height,
	-1);
gdk_draw_rectangle (win->pixmap,
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
TRUE,
widget->allocation.x,widget->allocation.y,
widget->allocation.width,widget->allocation.height);

}

regards,
Reham


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]