示例#1
0
 def __init__(self, master, text, imagePath=None, tooltip=None, **opts):
     defaults = {}
     # Used to be {'font': gui.fontButton} but there is no such
     # definition in pyworkflow/gui.
     defaults.update(opts)
     
     if 'bg' in defaults and defaults['bg'] is None:
         del defaults['bg']
     
     if imagePath is not None:
         btnImage = gui.getImage(imagePath, Button._images)
     else:
         btnImage = None
         
     if btnImage is not None:
         if 'compound' not in defaults:
             defaults['compound'] = tk.LEFT
         tk.Button.__init__(self, master, text=text, image=btnImage, **defaults)
         self.image = btnImage
     else:
         tk.Button.__init__(self, master, text=text, **defaults)
         
     if tooltip:
         from tooltip import ToolTip
         ToolTip(self, tooltip, 500)
示例#2
0
    def __init__(self, master, text, imagePath=None, tooltip=None, **opts):
        defaults = {}
        # Used to be {'font': gui.fontButton} but there is no such
        # definition in pyworkflow/gui.
        defaults.update(opts)

        if 'bg' in defaults and defaults['bg'] is None:
            del defaults['bg']

        if imagePath is not None:
            btnImage = gui.getImage(imagePath, Button._images)
        else:
            btnImage = None

        if btnImage is not None:
            if 'compound' not in defaults:
                defaults['compound'] = tk.LEFT
            tk.Button.__init__(self,
                               master,
                               text=text,
                               image=btnImage,
                               **defaults)
            self.image = btnImage
        else:
            tk.Button.__init__(self, master, text=text, **defaults)

        if tooltip:
            from tooltip import ToolTip
            ToolTip(self, tooltip, 500)
示例#3
0
 def _getImagePreview(self, filename):
     dim = 128
     
     if isStandardImage(filename):
         self.tkImg = gui.getImage(os.path.abspath(filename), tkImage=True, maxheight=dim)
     else:
         fn = self._index + filename
         self.tkImg = gui.getTkImage(self._image, fn, dim)
         
     return self.tkImg
示例#4
0
 def _getImagePreview(self, filename):
     dim = 128
     
     if isStandardImage(filename):
         self.tkImg = gui.getImage(os.path.abspath(filename),
                                   tkImage=True, maxheight=dim)
     else:
         fn = self._index + filename
         self.tkImg = gui.getTkImage(self._image, fn, dim)
         
     return self.tkImg
示例#5
0
 def setImage(self, imagePath):
     self.image = gui.getImage(imagePath)
     self.config(image=self.image)
示例#6
0
 def getImage(self, img):
     return gui.getImage(img, Tree._images)
示例#7
0
 def body(self, bodyFrame):
     self.image = gui.getImage(self.iconPath)
     createMessageBody(bodyFrame, self.msg, self.image)
示例#8
0
 def getImage(self, imgName):
     """A shortcut to get an image from its name"""
     return gui.getImage(imgName, self._images)
示例#9
0
 def setImage(self, imagePath):
     self.image = gui.getImage(imagePath)
     self.config(image=self.image)
示例#10
0
 def body(self, bodyFrame):
     self.image = gui.getImage(self.iconPath)
     createMessageBody(bodyFrame, self.msg, self.image)
示例#11
0
 def getImage(self, imgName):
     """A shortcut to get an image from its name"""
     return gui.getImage(imgName, self._images)
示例#12
0
文件: canvas.py 项目: coocoky/scipion
 def getImage(self, img):
     return gui.getImage(img, self._images)