Please explain 1st arg of configure & expose event functions...
- From: Chris Seberino <seberino spawar navy mil>
- To: gtk-list gnome org
- Subject: Please explain 1st arg of configure & expose event functions...
- Date: Wed, 6 Feb 2002 00:29:43 -0800
Examples of configure and expose event functions
have a mysterious GtkWidget for the first arg.
I cannot seem to discern what it is.
Please explain...
Here is an example of an expose event function:
gint middleMassTimeSeriesPlotPatch(GtkWidget* widget, GdkEventExpose* event) {
gdk_draw_pixmap(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
Pixmaps::middleMassTimeSeriesPlot, event->area.x, event->area.y,
event->area.x, event->area.y, event->area.width, event->area.height);
return FALSE;
};
Here is an example of a configure event function:
gint middleMassTimeSeriesPlotDraw(GtkWidget* widget, GdkEventConfigure* event) {
gdk_pixmap_unref(Pixmaps::middleMassTimeSeriesPlot);
Pixmaps::middleMassTimeSeriesPlot = gdk_pixmap_new(widget->window,
widget->allocation.width, widget->allocation.height, -1);
gdk_draw_rectangle(Pixmaps::middleMassTimeSeriesPlot,
widget->style->black_gc, TRUE, 0, 0,
widget->allocation.width, widget->allocation.height);
gdk_draw_line(Pixmaps::middleMassTimeSeriesPlot, widget->style->white_gc, 0, 0,
widget->allocation.width, widget->allocation.height);
gdk_draw_line(Pixmaps::middleMassTimeSeriesPlot,
widget->style->white_gc, 0, widget->allocation.height,
widget->allocation.width, 0);
return TRUE;
};
What is all this widget->allocation.height, widget->window stuff and where
did it come from and why is it useful?
Thanks,
Chris
--
=======================================================
| Dr. Christian Seberino || (619) 553-7940 (office) |
| SPAWARSYSCEN 2363 || (619) 553-2836 (fax) |
| 53560 HULL ST || |
| SAN DIEGO CA 92152-5001 || seberino spawar navy mil |
=======================================================
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]