Example #1
0
    def draw_fixed_background(self, widget, event):    
        cr = widget.window.cairo_create()
        x, y, w, h = widget.allocation
        
        cr.set_source_rgb(1, 1, 1)
        cr.rectangle(x, y, w, h)
        cr.fill()

        # # Draw point.
        for x_padding in range(0, w, 5):
            for y_pdding in range(0, h, 5):
                cr.set_source_rgb(0, 0, 0)
                cr.rectangle(x + x_padding, 
                             y + y_pdding, 
                             1, 1)
                cr.fill()
        #         self.draw_rectangle(cr, x + x_padding, y + y_pdding, 0.2, 0.2)

        for w in all_widget:                
            if w.press_bool:
                draw_press_rectangle(cr,
                                     w.allocation.x,
                                     w.allocation.y,
                                     w.allocation.width,
                                     w.allocation.height
                                     )                
                
                self.queue_draw_area(w.allocation.x,
                                     w.allocation.y,
                                     w.allocation.width,
                                     w.allocation.height)
Example #2
0
    def draw_button(self, widget, event):
        cr = widget.window.cairo_create()
        x, y, w, h = widget.allocation

        draw_background(cr, x, y, w, h, "image/button/button.png")

        if widget.get_child() != None:
            widget.propagate_expose(widget.get_child(), event)

        global all_widget

        for w in all_widget:
            if w.press_bool:
                draw_press_rectangle(cr, w.allocation.x, w.allocation.y,
                                     w.allocation.width, w.allocation.height)

        return True
Example #3
0
    def draw_progressbar(self, widget, event):
        cr = widget.window.cairo_create()
        x, y, w, h = widget.allocation

        cr.set_source_rgb(0, 0, 0)
        cr.rectangle(x, y, w, h)
        cr.stroke()

        cr.set_source_rgb(0, 0, 1)
        cr.rectangle(x + 1, y + 1, w / 2, h - 2)
        cr.fill()

        global all_widget

        for w in all_widget:
            if w.press_bool:
                draw_press_rectangle(cr, w.allocation.x, w.allocation.y,
                                     w.allocation.width, w.allocation.height)

        return True
Example #4
0
 def draw_button(self, widget, event):    
     cr = widget.window.cairo_create()
     x, y, w, h = widget.allocation
             
     draw_background(cr, x, y, w, h, "image/button/button.png")
                 
     if widget.get_child() != None:
         widget.propagate_expose(widget.get_child(), event)
         
     global all_widget    
     
     for w in all_widget:                
         if w.press_bool:
             draw_press_rectangle(cr,
                                  w.allocation.x,
                                  w.allocation.y,
                                  w.allocation.width,
                                  w.allocation.height
                                  )                    
             
     return True
Example #5
0
    def draw_fixed_background(self, widget, event):
        cr = widget.window.cairo_create()
        x, y, w, h = widget.allocation

        cr.set_source_rgb(1, 1, 1)
        cr.rectangle(x, y, w, h)
        cr.fill()

        # # Draw point.
        for x_padding in range(0, w, 5):
            for y_pdding in range(0, h, 5):
                cr.set_source_rgb(0, 0, 0)
                cr.rectangle(x + x_padding, y + y_pdding, 1, 1)
                cr.fill()
        #         self.draw_rectangle(cr, x + x_padding, y + y_pdding, 0.2, 0.2)

        for w in all_widget:
            if w.press_bool:
                draw_press_rectangle(cr, w.allocation.x, w.allocation.y,
                                     w.allocation.width, w.allocation.height)

                self.queue_draw_area(w.allocation.x, w.allocation.y,
                                     w.allocation.width, w.allocation.height)
Example #6
0
 def draw_progressbar(self, widget, event):
     cr = widget.window.cairo_create()        
     x, y, w, h = widget.allocation
     
     cr.set_source_rgb(0, 0, 0)
     cr.rectangle(x, y, w, h)
     cr.stroke()
     
     cr.set_source_rgb(0, 0, 1)
     cr.rectangle(x+1, y+1, w/2, h-2)
     cr.fill()
     
     global all_widget    
     
     for w in all_widget:                
         if w.press_bool:
             draw_press_rectangle(cr,
                                  w.allocation.x,
                                  w.allocation.y,
                                  w.allocation.width,
                                  w.allocation.height
                                  )                
 
     return True