Please explain 1st arg of configure & expose event functions...



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]