private void DrawingArea_Draw(object sender, CairoEventArgs e) { using (var ctx = e.GetDrawingContext()) { ctx.SetSourceRgb(0.6, 0.6, 0.6); ctx.SetLineWidth(1); ctx.DrawRectangle(20, 20, 120, 80); ctx.StrokePreserve(); ctx.Fill(); return; /* * if (clicks > 2) * { * ctx.SelectFontFace("Arial"); * ctx.SetFontSize(40.0); * ctx.MoveTo(10.0, 50.0); * ctx.ShowText("Disziplin ist Macht."); * } * * if(clicks == 5) * { * Application.Current.Exit(0); * } */ } }
private void DrawingArea_Draw(object sender, CairoEventArgs e) { using (var ctx = e.GetDrawingContext()) { if (clicks > 2) { ctx.SetSourceRgb(0, 0, 0); ctx.SelectFontFace("Arial"); ctx.SetFontSize(40.0); ctx.MoveTo(10.0, 50.0); ctx.ShowText("Disziplin ist Macht."); } if (clicks == 5) { Application.Current.Exit(0); } } }