Re: Erasing bug in GTK examples/gtkdial
- From: otaylor redhat com
- To: BJerrick easystreet com
- Cc: gtk-list gnome org
- Subject: Re: Erasing bug in GTK examples/gtkdial
- Date: 15 Oct 2000 08:23:21 -0400
Thanks for catching the bug. But I don't like the patch, because
I definitely don't like the hack that it fixes.
I don't know who put the code in to erase the dial that way - I
guess it's:
=======
Sat Nov 13 22:30:29 GMT 1999 Tony Gale <gale gtk org>
* docs/gtkfaq.sgml: threads example from Erik Mouw.
New question on GtkLabel background colors.
* docs/gtk_tut.sgml:
- Correct the example code callback
function definitions.
- Update the gtkdial example code, from Frans van Schaik.
- Update setselection.c to current API.
=======
But it needs to be removed. This is supposed to be clean _example_
code, not hack-around-sort-of-reduce-flicker code.
Plus, in GTK+-2.0, GTK+ makes handling no-flicker with backing
store really easy.
Regards,
Owen
BJerrick easystreet com writes:
> The pointer in examples/gtkdial (gtk+-1.2.6 through gtk+-snap20000810,
> at least) doesn't erase completely when moved. This is due to two
> bugs in the widget's code, gtkdial.c .
>
> A fix for both is below. The added comment explains the first.
> The second changes the 'fill' argument of the gtk_draw_polygon() that
> does the erasing to match that used for drawing (TRUE, i.e., filled).
>
> Bruce Jerrick
> Portland, Oregon, USA
> email: bjerrick easystreet com
>
>
> --- examples/gtkdial/gtkdial.c.0 Fri Aug 18 05:29:10 2000
> +++ examples/gtkdial/gtkdial.c Wed Oct 11 23:48:58 2000
> @@ -322,21 +322,26 @@
> points[4].y = points[0].y;
>
> blankstyle = gtk_style_new ();
> + /*
> + * Use bg_gc for all gc's used by gtk_default_draw_polygon()
> + * (bg_gc, dark_gc, light_gc, black_gc).
> + * Widget's style was set using GTK_STATE_ACTIVE, so use that bg_gc.
> + */
> blankstyle->bg_gc[GTK_STATE_NORMAL] =
> - widget->style->bg_gc[GTK_STATE_NORMAL];
> + widget->style->bg_gc[GTK_STATE_ACTIVE];
> blankstyle->dark_gc[GTK_STATE_NORMAL] =
> - widget->style->bg_gc[GTK_STATE_NORMAL];
> + widget->style->bg_gc[GTK_STATE_ACTIVE];
> blankstyle->light_gc[GTK_STATE_NORMAL] =
> - widget->style->bg_gc[GTK_STATE_NORMAL];
> + widget->style->bg_gc[GTK_STATE_ACTIVE];
> blankstyle->black_gc =
> - widget->style->bg_gc[GTK_STATE_NORMAL];
> + widget->style->bg_gc[GTK_STATE_ACTIVE];
>
> gtk_draw_polygon (blankstyle,
> widget->window,
> GTK_STATE_NORMAL,
> GTK_SHADOW_OUT,
> points, 5,
> - FALSE);
> + TRUE);
>
> gtk_style_unref(blankstyle);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]