def paint_self(self):
        #self._border_width = self.get_border_width()
        (self._width, self._height) = self.get_size()
        if (self._width < self._border_width) or \
            (self._height < self._border_width):
            return
        self._arc = 10
        self._step = 10

        cogl.path_polygon(0.0, 0.0, self._width, 0.0, 0.0, self._height)
        cogl.path_close()
        cogl.path_fill()
        
        glBegin(GL_TRIANGLES)
        # Draw the highlight
        glColor(*self._highlight_color)
        glVertex2f(0.0, self._height)
        glVertex2f(0,0)
        glVertex2f(self._width,0.0)    
        # Draw the lowlight
        glColor(*self._lowlight_color)   
        glVertex2f(self._width, self._height)
        glVertex2f(0.0, self._height)
        glVertex2f(self._width,0.0)

        # draw the middle
        glColor(*self._color)
        glVertex2f(self._border_width, self._height - self._border_width)
        glVertex2f(self._border_width,self._border_width)
        glVertex2f(self._width - self._border_width,self._border_width) 
        glVertex2f(self._width - self._border_width, self._height - self._border_width)
        glVertex2f(self._border_width, self._height - self._border_width)
        glVertex2f(self._width - self._border_width,self._border_width) 
        glEnd()
Ejemplo n.º 2
0
    def __paint_triangle (self, color):
        cogl.push_matrix()
        cogl.set_source_color(color)

        width, height = self.get_geometry()[2:]

        # Paint a triangle
        cogl.path_polygon(0, 0, 0, height, width, height)
        cogl.path_fill()
        cogl.pop_matrix()
Ejemplo n.º 3
0
    def __paint_triangle(self, color):
        cogl.push_matrix()
        cogl.set_source_color(color)

        width, height = self.get_geometry()[2:]

        # Paint a triangle
        cogl.path_polygon(0, 0, 0, height, width, height)
        cogl.path_fill()
        cogl.pop_matrix()