Esempio n. 1
0
 def add_action(self, text, toggle=False, iconpath=None):
     child = ToolbarAction()
     self.text = text
     if iconpath:
         native_image = PgHelp.get_icon(iconpath, size=(24, 24),
                                        format='png')
         widget = Image(native_image=native_image)
         widget.resize(24, 24)
     else:
         widget = Button(text)
     child.checkable = toggle
     child.widget = widget
     self.widget.add_widget(child, stretch=0)
     return child
Esempio n. 2
0
    def draw_image(self, img_buf, x, y, width=None, height=None):

        img_src = PgHelp.get_image_src_from_buffer(img_buf)

        self._draw("image", x=x, y=y, src=img_src, width=width, height=height)
Esempio n. 3
0
    def _set_image(self, native_image):
        self.image = native_image
        self.img_src = PgHelp.get_image_src_from_buffer(self.image)

        app = self.get_app()
        app.do_operation('update_imgsrc', id=self.id, value=self.img_src)