Re: Problems with expose_event->region patch
- From: Owen Taylor <otaylor redhat com>
- To: gtk-devel-list gnome org
- Subject: Re: Problems with expose_event->region patch
- Date: 09 Mar 2001 10:38:14 -0500
Alexander Larsson <alla lysator liu se> writes:
> On 8 Mar 2001, Havoc Pennington wrote:
> > > +/**
> > > + * gtk_widget_send_expose:
> > > + * @widget: a #GtkWidget
> > > + * @event: a expose #GdkEvent
> > > + *
> > > + * Very rarely-used function. This function is used to emit
> > > + * an expose event signals on a widget. This function is not
> > > + * normally used directly. The only time it is used is when
> > > + * propagating an expose event to a child NO_WINDOW widget, and
> > > + * that is normally done using gtk_container_propagate_expose.
> > > + *
> > > + * If you just want to synthesize an expose event, use
> > > + * gdk_window_invalidate_rect() to invalidate a region of the
> > > + * window.
> > > + *
> > > + * Return value: return from the event signal emission (%TRUE if the event was handled)
> > > + **/
> >
> > If people aren't supposed to use this, maybe it should be an internal
> > function with prepended underscore?
>
> If gtk_widget_send_expose is private. How do i do this (from gtkclist.c):
>
> check_exposures (GtkCList *clist)
> {
> GdkEvent *event;
>
> if (!GTK_WIDGET_REALIZED (clist))
> return;
>
> /* Make sure graphics expose events are processed before scrolling
> * again */
> while ((event = gdk_event_get_graphics_expose (clist->clist_window)) != NULL)
> {
> gtk_widget_send_expose (GTK_WIDGET (clist), event);
> if (event->expose.count == 0)
> {
> gdk_event_free (event);
> break;
> }
> gdk_event_free (event);
> }
> }
>
> gtktext.c does the same in process_exposes(). I could just call
> _gtk_widget_send_expose here, since this is part of gtk+, but i get the
> feeling that this should be done some other way now.
You should be able to switch this code over to
gdk_window_scroll (clist->clist_window, ...);
gdk_window_process_updates (clist->clist_window, FALSE);
[ There is some argument the second call should be
gdk_window_process_all_updates() to make sure that the
scrollbar eventually does get updated ]
gdk_window_scroll() keeps an queue of translations, so there
is no need to process all graphics exposes before scrolling
again.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]