diff --git a/ChangeLog b/ChangeLog index fd668f810..f0004e052 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-05-18 Todd Berman + + * samples/Scribble.cs: Im bored, you can erase, etc + 2004-05-18 Mike Kestner * glib/MissingIntPtrCtorException.cs : new exception to throw if diff --git a/sample/Scribble.cs b/sample/Scribble.cs index 59c083ecf..848b604e6 100644 --- a/sample/Scribble.cs +++ b/sample/Scribble.cs @@ -68,7 +68,7 @@ namespace GtkSamples { args.RetVal = true; } - static void DrawBrush (double x, double y) + static void DrawBrush (double x, double y, bool black) { Gdk.Rectangle update_rect = new Gdk.Rectangle (); update_rect.X = (int) x - 5; @@ -76,7 +76,7 @@ namespace GtkSamples { update_rect.Width = 10; update_rect.Height = 10; - pixmap.DrawRectangle (darea.Style.BlackGC, true, + pixmap.DrawRectangle (black ? darea.Style.BlackGC : darea.Style.WhiteGC, true, update_rect.X, update_rect.Y, update_rect.Width, update_rect.Height); darea.QueueDrawArea (update_rect.X, update_rect.Y, @@ -87,8 +87,9 @@ namespace GtkSamples { { Gdk.EventButton ev = args.Event; if (ev.Button == 1 && pixmap != null) - DrawBrush (ev.X, ev.Y); - + DrawBrush (ev.X, ev.Y, true); + else if (ev.Button == 3 && pixmap != null) + DrawBrush (ev.X, ev.Y, false); args.RetVal = true; } @@ -110,7 +111,9 @@ namespace GtkSamples { } if ((state & Gdk.ModifierType.Button1Mask) != 0 && pixmap != null) - DrawBrush (x, y); + DrawBrush (x, y, true); + else if ((state & Gdk.ModifierType.Button3Mask) != 0 && pixmap != null) + DrawBrush (x, y, false); args.RetVal = true; }