seed r399 - trunk/modules/canvas
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r399 - trunk/modules/canvas
- Date: Sat, 6 Dec 2008 03:16:05 +0000 (UTC)
Author: racarr
Date: Sat Dec 6 03:16:05 2008
New Revision: 399
URL: http://svn.gnome.org/viewvc/seed?rev=399&view=rev
Log:
Another Canvas test.
Added:
trunk/modules/canvas/test12.js (contents, props changed)
Modified:
trunk/modules/canvas/Makefile.am
Modified: trunk/modules/canvas/Makefile.am
==============================================================================
--- trunk/modules/canvas/Makefile.am (original)
+++ trunk/modules/canvas/Makefile.am Sat Dec 6 03:16:05 2008
@@ -7,7 +7,7 @@
libsqlite_la_LDFLAGS = \
`pkg-config --libs seed cairo`
-EXTRA_DIST=test1.js test2.js test3.js test4.js test5.js test6.js test7.js test8.js test9.js test10.js test11.js
+EXTRA_DIST=test1.js test2.js test3.js test4.js test5.js test6.js test7.js test8.js test9.js test10.js test11.js test12.js
AM_CPPFLAGS = \
-I../../libseed/ \
Added: trunk/modules/canvas/test12.js
==============================================================================
--- (empty file)
+++ trunk/modules/canvas/test12.js Sat Dec 6 03:16:05 2008
@@ -0,0 +1,44 @@
+#!/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);
+
+ ctx.fillStyle = 'rgb(255,221,0)';
+ ctx.fillRect(0,0,150,37.5);
+ ctx.fillStyle = 'rgb(102,204,0)';
+ ctx.fillRect(0,37.5,150,37.5);
+ ctx.fillStyle = 'rgb(0,153,255)';
+ ctx.fillRect(0,75,150,37.5);
+ ctx.fillStyle = 'rgb(255,51,0)';
+ ctx.fillRect(0,112.5,150,37.5);
+
+ // Draw semi transparent rectangles
+ for (i=0;i<10;i++){
+ ctx.fillStyle = 'rgba(255,255,255,'+(i+1)/10+')';
+ for (j=0;j<4;j++){
+ ctx.fillRect(5+i*14,5+j*37.5,14,27.5)
+ }
+ }
+
+ return true;
+ });
+Gtk.main();
+
+
+
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]