[cairo-commit] pycairo/examples/gtk cairo-demo.py, 1.2,
1.3 hangman.py, 1.3, 1.4 lsystem.py, 1.2, 1.3 text.py, 1.3, 1.4
Steve Chaplin
commit at pdx.freedesktop.org
Thu Apr 14 20:25:39 PDT 2005
Committed by: stevech1097
Update of /cvs/cairo/pycairo/examples/gtk
In directory gabe:/tmp/cvs-serv26442/examples/gtk
Modified Files:
cairo-demo.py hangman.py lsystem.py text.py
Log Message:
SC 2005/04/15
Index: cairo-demo.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/cairo-demo.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo-demo.py 19 Mar 2005 11:27:21 -0000 1.2
+++ cairo-demo.py 15 Apr 2005 03:25:37 -0000 1.3
@@ -87,7 +87,7 @@
ctx = cairo.Context()
cairo.gtk.set_target_drawable(ctx, drawable)
- ctx.set_rgb_color(0, 0, 0)
+ ctx.set_source_rgb(0, 0, 0)
ctx.set_line_width(SIZE / 4)
ctx.set_tolerance(0.1)
@@ -109,7 +109,7 @@
ctx.set_line_join(cairo.LINE_JOIN_BEVEL)
fill_shapes(ctx, 0, 15*SIZE)
- ctx.set_rgb_color(1,0,0)
+ ctx.set_source_rgb(1,0,0)
stroke_shapes(ctx, 0, 15*SIZE)
def main():
Index: hangman.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/hangman.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hangman.py 9 Apr 2005 03:57:05 -0000 1.3
+++ hangman.py 15 Apr 2005 03:25:37 -0000 1.4
@@ -72,7 +72,7 @@
ctx.set_target_surface (surface)
# set the background
- ctx.set_rgb_color(0.7,0.7,0.7)
+ ctx.set_source_rgb(0.7,0.7,0.7)
ctx.rectangle(0,0,width, height)
ctx.fill()
@@ -83,7 +83,7 @@
return len(letters_guessed_wrong) == body_parts
ctx.set_font_size(10)
- ctx.set_rgb_color(0,0,0)
+ ctx.set_source_rgb(0,0,0)
for idxLetter in range(len(word_chosen)):
#print "Examining letter: " + word_chosen[idxLetter]
if word_chosen[idxLetter].lower() in letters_guessed_right or man_hung():
@@ -100,7 +100,7 @@
# Draw Letters Guessed
ctx.move_to(0, 160)
- ctx.set_rgb_color(0, 0, 0)
+ ctx.set_source_rgb(0, 0, 0)
ctx.show_text(letters_guessed)
# Draw noose
@@ -109,7 +109,7 @@
ctx.line_to(100, 5)
ctx.line_to(130, 5)
ctx.line_to(130, 100)
- ctx.set_rgb_color(0, 0, 0)
+ ctx.set_source_rgb(0, 0, 0)
ctx.stroke()
# Draw base fill color
@@ -125,7 +125,7 @@
ctx.line_to(70, 114)
ctx.line_to(70, 106)
ctx.line_to(130, 106)
- ctx.set_rgb_color(.4, .2, .1)
+ ctx.set_source_rgb(.4, .2, .1)
ctx.fill()
# Draw base outline color
@@ -139,7 +139,7 @@
ctx.line_to(40, 130)
ctx.line_to(50, 130)
ctx.line_to(130, 130)
- ctx.set_rgb_color(0, 0, 0)
+ ctx.set_source_rgb(0, 0, 0)
ctx.stroke()
# Draw 2nd stair
@@ -206,7 +206,7 @@
ctx.set_line_width(.5)
ctx.stroke()
- ctx.set_rgb_color(0, 0, 0)
+ ctx.set_source_rgb(0, 0, 0)
ctx.set_line_width(1)
# Draw Body
Index: lsystem.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/lsystem.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- lsystem.py 19 Mar 2005 11:27:21 -0000 1.2
+++ lsystem.py 15 Apr 2005 03:25:37 -0000 1.3
@@ -31,7 +31,7 @@
ctx = cairo.Context()
cairo.gtk.set_target_drawable(ctx, drawable)
- ctx.set_rgb_color(0, 0, 0)
+ ctx.set_source_rgb(0, 0, 0)
ctx.set_line_width(self.SIZE / 4)
ctx.set_tolerance(0.1)
Index: text.py
===================================================================
RCS file: /cvs/cairo/pycairo/examples/gtk/text.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- text.py 9 Apr 2005 03:57:05 -0000 1.3
+++ text.py 15 Apr 2005 03:25:37 -0000 1.4
@@ -24,11 +24,11 @@
ctx.rel_line_to(0, height + 20)
ctx.rel_line_to(-(width + 20), 0)
ctx.close_path()
- ctx.set_rgb_color(0,0,1)
+ ctx.set_source_rgb(0,0,1)
ctx.stroke()
ctx.move_to(0, 0)
- ctx.set_rgb_color(0,0,0)
+ ctx.set_source_rgb(0,0,0)
ctx.show_text('Hello World')
win = gtk.Window()
More information about the cairo-commit
mailing list