예제 #1
0
    def __init__(self, cal, **kwargs):
        """
        Constructor.
        """
        hippo.CanvasBox.__init__(self, **kwargs)

        self.cal = cal
        self.date = kwargs.get('date')
        self.active = True
        self.selected = False
        self.highlighted = False
        self.show_rulers = False

        # Create canvas items.
        self.box = hippo.CanvasGradient(padding=2, padding_right=5)
        self.text = hippo.CanvasText(xalign=hippo.ALIGNMENT_END,
                                     size_mode=hippo.CANVAS_SIZE_ELLIPSIZE_END)
        self.body = hippo.CanvasGradient()

        self.box.append(self.text, hippo.PACK_EXPAND)
        self.append(self.box)
        self.append(self.body, hippo.PACK_EXPAND)
        self.box.set_visible(True)
예제 #2
0
    def __init__(self, cal, **kwargs):
        """
        Constructor.
        """
        hippo.CanvasBox.__init__(self, **kwargs)

        self.cal = cal
        self.text = {}

        # Create canvas items.
        for n in range(0, 24):
            if n == -1:
                caption = ' '
            else:
                caption = '%d' % n
            box = hippo.CanvasGradient(padding_right=5)
            text = hippo.CanvasText(text=caption,
                                    xalign=hippo.ALIGNMENT_END,
                                    yalign=hippo.ALIGNMENT_START)
            box.append(text, hippo.PACK_EXPAND)
            self.append(box, hippo.PACK_EXPAND)