@shellex说: 对对,他们上辈子都是折翼的新奥尔良鸡翅

Pages

Topics

随便看看

路边社评论员

  • Keith:
    还能用不. »
  • deepblue:
    测试一下浏览器和系统 »
  • abettor:
    “就和CPU特权级别一样”——这的哥难道是Linus的表弟?! »
  • 董英男:
    为什么总提示确认是相册首页呢 到底哪个才是相册首页啊 »
  • kendisk:
    作为一个轻度Linuxer,刚分手后,感觉木有鸭梨。 »
  • MS IE:
    THIS SITE REALLY SUCK! »
  • Alex:
    gnome-women... »
  • liangsuilong:
    GNOME 自己也有鼓励女性参与项目的计划啊.. »
  • infinte:
    对不起,你的“解ban”版本算得有点问题,可以下(9)pp4 测试。ACID3可有95分啊……另外同... »
  • Alex:
    »
  • Randee Saadat:
    Glad you solved your problem, but what is your que... »
  • LinuxRock:
    没想到你也有一台和我一样的破机子......还好现在高三没怎么用,受不了它的发热量.. »

Posts Tagged ‘cairo’

自己做一个cairo clock

由于手头工作的原因,我要接触cairo这个矢量图形库,因为它的免费高效跨平台。如果你现在使用的Firefox 3浏览器,那么恭喜你,Cairo正在为你工作。当然了,GTK和Gnome这样的项目也采用了Cairo。
Cairo:http://www.cairographics.org/
下面的内容你可能需要一些GTK和python的前置知识。还有Cairo本身.

import gtk
import pygtk
import cairo
import math
import time
import gobject

class Clock(gtk.DrawingArea):
def progress_timeout(self, object):
width, height = self.get_parent().size_request()
#Adds region to the update area for window
object.window.invalidate_rect((0, 0, width, height), False)
return True

def __init__(self):
gtk.DrawingArea.__init__(self)
self.connect(“expose_event”, self.expose_cb)
self.timer = gobject.timeout_add (300, self.progress_timeout, self)

def expose_cb(self, widget, event):
self.context = widget.window.cairo_create()
# set a clip region for the expose event
self.context.rectangle(event.area.x, event.area.y,
[...]

Page 1 of 11