Exemplo n.º 1
0
    def __init__(self,
                 master,
                 category,
                 column,
                 anchor='center',
                 command=None,
                 style='heading.TLabel',
                 compound='right',
                 **kwargs):
        Label.__init__(self,
                       master,
                       class_='ManagerHeading',
                       style=style,
                       anchor=anchor,
                       compound=compound,
                       **kwargs)
        self.category = category
        self.column = column
        self.reverse = False
        self.state(['alternate'])

        if command is not None:
            self.bind('<Button-1>', command)

        if not Heading._initialized:
            for seq in self.bind_class('TButton'):
                self.bind_class('ManagerHeading', seq,
                                self.bind_class('TButton', seq))
            Heading._initialized = True
    def __init__(self, master, filename):
        im = Image.open(filename)

        seq = []

        try:
            while True:
                seq.append(im.copy())
                im.seek(len(seq))

        except EOFError:
            pass

        try:
            self.__delay = im.info["duration"]

        except KeyError:
            self.__delay = 100

        first = seq[0].convert("RGBA")

        self.__frames = [ImageTk.PhotoImage(first)]

        Label.__init__(self, master, image=self.__frames[0])

        temp = seq[0]

        for image in seq[1:]:
            temp.paste(image)
            frame = temp.convert("RGBA")

            self.__frames.append(ImageTk.PhotoImage(frame))

        self.__frameIndex = 0

        self.__periodicalAfter = PeriodicalAfter(self, self.__nextFrame)
Exemplo n.º 3
0
 def __init__(self, master, text):
     '''
     Wrapper for Tk Label() object with a specified font
     '''
     Label.__init__(self, master, text=text, font='TkDefaultFont 12 bold')
Exemplo n.º 4
0
 def __init__(self, master=None, **kwargs):
     Label.__init__(self, master, **kwargs)
     self.bind('<Configure>',
               lambda e: self.configure(wraplength=self.winfo_width() - 20))