[cairo-commit] cairo-demo/python ChangeLog,1.4,1.5 hangman.py,1.4,1.5
Carl Worth
commit at pdx.freedesktop.org
Mon Aug 15 11:12:59 PDT 2005
Committed by: cworth
Update of /cvs/cairo/cairo-demo/python
In directory pdx:/tmp/cvs-serv23580
Modified Files:
ChangeLog hangman.py
Log Message:
* hangman.py (expose_event): Need to call scale_font before ever
showing text. Remove unnecessary __main__.
Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/python/ChangeLog,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ChangeLog 14 Feb 2004 22:44:45 -0000 1.4
--- ChangeLog 14 Feb 2004 22:51:55 -0000 1.5
***************
*** 1,2 ****
--- 1,7 ----
+ 2004-02-14 Carl Worth <cworth at isi.edu>
+
+ * hangman.py (expose_event): Need to call scale_font before ever
+ showing text. Remove unnecessary __main__.
+
2004-02-14 Kevin <kevin at ender>
Index: hangman.py
===================================================================
RCS file: /cvs/cairo/cairo-demo/python/hangman.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** hangman.py 14 Feb 2004 22:44:45 -0000 1.4
--- hangman.py 14 Feb 2004 22:51:55 -0000 1.5
***************
*** 42,46 ****
word_chosen = words[idxRandom]
!
def guess_letter(widget, event):
--- 42,46 ----
word_chosen = words[idxRandom]
! print "The secret word is " + word_chosen
def guess_letter(widget, event):
***************
*** 77,88 ****
return False
! for idxLetter in range(len(__main__.word_chosen)):
! if __main__.word_chosen[idxLetter].lower() in letters_guessed_right or man_hung():
if idxLetter == 0:
cr.move_to(0, 150)
! cr.show_text(__main__.word_chosen[idxLetter].upper())
else:
cr.move_to(idxLetter * 15, 150)
! cr.show_text(__main__.word_chosen[idxLetter].lower())
else:
cr.move_to(idxLetter * 15, 150)
--- 77,91 ----
return False
! cr.scale_font(10)
! cr.set_rgb_color(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():
if idxLetter == 0:
cr.move_to(0, 150)
! cr.show_text(word_chosen[idxLetter].upper())
else:
cr.move_to(idxLetter * 15, 150)
! cr.show_text(word_chosen[idxLetter].lower())
else:
cr.move_to(idxLetter * 15, 150)
***************
*** 91,95 ****
# Draw Letters Guessed
- cr.scale_font(10)
cr.move_to(0, 160)
cr.set_rgb_color(0, 0, 0)
--- 94,97 ----
More information about the cairo-commit
mailing list