seed r397 - trunk/modules/canvas
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r397 - trunk/modules/canvas
- Date: Sat, 6 Dec 2008 02:51:20 +0000 (UTC)
Author: racarr
Date: Sat Dec 6 02:51:20 2008
New Revision: 397
URL: http://svn.gnome.org/viewvc/seed?rev=397&view=rev
Log:
Add color parsing test.
Added:
trunk/modules/canvas/test10.js (contents, props changed)
Added: trunk/modules/canvas/test10.js
==============================================================================
--- (empty file)
+++ trunk/modules/canvas/test10.js Sat Dec 6 02:51:20 2008
@@ -0,0 +1,35 @@
+#!/usr/local/bin/seed
+Seed.import_namespace("Gdk");
+Seed.import_namespace("Gtk");
+Seed.import_namespace("Canvas");
+
+
+Gtk.init(null, null);
+
+w = new Gtk.Window();
+d = new Gtk.DrawingArea();
+w.add(d);
+
+w.resize(150, 150);
+
+w.show_all();
+
+d.signal.expose_event.connect(function(){
+ var cr = Gdk.cairo_create(d.window);
+ var ctx = new Canvas.CairoCanvas(cr);
+
+
+ for (i=0;i<6;i++){
+ for (j=0;j<6;j++){
+ ctx.fillStyle = 'rgb(' + Math.floor(255-42.5*i) + ',' +
+ Math.floor(255-42.5*j) + ',0)';
+ ctx.fillRect(j*25,i*25,25,25);
+ }
+ }
+ return true;
+ });
+Gtk.main();
+
+
+
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]