Re: drawing area and expose event



> The expose handler must be able to redraw any area anyway, so you may
> as well put all drawing there for code cleanliness; putting all
> drawing there is also crucial to be sure you don't have any flicker in
> GTK 2.

My code does not flicker now on GTK or Win32. So if GTK 2 makes my code
flicker, what does that mean?

Best Regards,
Norman Black
Stony Brook Software

----- Original Message -----
From: "Havoc Pennington" <hp redhat com>
To: "Norman Black" <stonybrk ix netcom com>
Cc: "gtk-list" <gtk-list gnome org>
Sent: Wednesday, February 27, 2002 9:43 AM
Subject: Re: drawing area and expose event


>
> "Norman Black" <stonybrk ix netcom com> writes:
> >
> > Are you saying that when a user hits the "e" key in my program I
should
> > generate an expose event to draw the "e" in my window rather than
simply
> > draw the "e" in response to them pressing "e".
> >
>
> What you should do is call gtk_widget_queue_draw_area() or
> gdk_window_invalidate_rect() for the rectangle containing the
> "e". Then you will get an expose event for that area, and then you
> paint the "e"
>
> So all drawing is in the expose handler.
>
> The expose handler must be able to redraw any area anyway, so you may
> as well put all drawing there for code cleanliness; putting all
> drawing there is also crucial to be sure you don't have any flicker in
> GTK 2.
>
> Havoc




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