-----Original Message----- From: Erik Jonsson [mailto:erik@xxxxxxxx] Sent: Thursday, September 08, 2005 12:53 PM To: simith@xxxxxxxxxxxxxxx; gtk-list@xxxxxxxxx Subject: Re: Problem with the expose-event Hi.. The expose event happens quite often. Whenever a part of the screen has to be redrawn. I think what you are looking for is on_configure_event. This event only happens if the drawing area is re sized. I would recommend that you draw all your graphics to a pixmap in your on_configure_event and then use on_expose to draw the pixmap to the drawing area. Here is my expose code. back is the pixmap: bool GtkStaff::on_expose_event(GdkEventExpose *event) { int width = get_allocation().get_width(); int height = get_allocation().get_height(); if(back) { Glib::RefPtr<Gdk::GC> gc = Gdk::GC::create(get_window()); Gdk::Rectangle rec(0,0, width, height); gc->set_clip_rectangle(rec); get_window()->draw_drawable(gc, back, 0, 0, 0, 0); gc.clear(); } return false; } On 8/9/2005, "Simith Nambiar" <simith@xxxxxxxxxxxxxxx> wrote: >Hi All, > I have a problem with the expose-event getting called for >my Drawing Area continiously. >Here is what i'am doing , i have 3 Drawing Areas in a Horizontal box of a >Window. > >I have set the same expose handler for all of the drawing areas, when the >program starts the Expose Event handler , >would pick up the user data , and then , find out the image to be >displayed. > >I expect it to be called 3 times when the program comes up , but i see it >happenning continiously. >I connect to the Linux system where i run the program through a Vnc Client . > >Anyone has faced a similar problem or any suggestions welcome. > >Thank you. > >Cheers, >Simith Nambiar Hi Erik , Thanks for your response, actually the problem was with me calling a resize_request on the drawing area in the expose-event, before drawing to it, which again trigerred an expose-event ! Got a hint from Przemyslaw Sitek, from this list, which made me have another look at the code. Thanks anyway ! Cheers. Simith _______________________________________________ gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list ______________________________________________________________________ This email has been scanned via a message filtering facility. If you have any issues with your email, please contact the IT Dept. _______________________________________________ gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list