diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-07-19 23:18:05 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-07-19 23:18:05 (GMT) |
commit | 51b7ec2cdef0824b7c0760ab5b21e7e5320f115f (patch) | |
tree | dbcd18c8792bfc9a9e4881b9b9cb882c7e7665da /taturtle.py | |
parent | 853f1ec75289eb80ce95ab7c4596309dbfa8737b (diff) |
cleaned up some print/show code
Diffstat (limited to 'taturtle.py')
-rw-r--r-- | taturtle.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/taturtle.py b/taturtle.py index 9479c97..f3d408a 100644 --- a/taturtle.py +++ b/taturtle.py @@ -254,13 +254,16 @@ def draw_text(t, label, x, y, size, w): pass if type(label) == str or type(label) == unicode: pl = t.tw.window.create_pango_layout(label.replace("\0"," ")) - pl.set_font_description(fd) - pl.set_width(int(w)*pango.SCALE) - t.canvas.image.draw_layout(t.gc,int(x),int(y),pl) - w,h = pl.get_pixel_size() - invalt(t,x,y,w,h) + elif type(label) == float or type(label) == int: + pl = t.tw.window.create_pango_layout(str(label)) else: print type(label) + pl.set_font_description(fd) + pl.set_width(int(w)*pango.SCALE) + t.canvas.image.draw_layout(t.gc,int(x),int(y),pl) + w,h = pl.get_pixel_size() + invalt(t,x,y,w,h) + def draw_line(t,x1,y1,x2,y2): x1,y1 = t.width/2+int(x1), t.height/2-int(y1) |