CustomFrame   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 22
rs 10
wmc 6

4 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 4 1
A informHeight() 0 2 1
A grid() 0 2 1
A __init__() 0 10 3
1
import tkinter
2
3
4
class CustomFrame(tkinter.Frame):
5
    def __init__(self, *args, **kwargs):
6
        super(CustomFrame, self).__init__(*args, **kwargs)
7
        self.bind("<Configure>", self.configure)
8
        self.drawn = []
9
        self.height = 0
10
        self.width = 0
11
        if "height" in kwargs:
12
            self.height = kwargs["height"]
13
        if "width" in kwargs:
14
            self.width = kwargs["width"]
15
16
    def configure(self, event):
17
        self.height = event.height
18
        self.width = event.width
19
        self.informHeight()
20
21
    def informHeight(self):
22
        pass
23
24
    def grid(self, *args, **kwargs):
25
        pass
26
27
28
class CustomLabel(tkinter.Frame):
29
    pass
30
31
32
if __name__ == '__main__':
33
    master = tkinter.Tk()
34
    i = CustomFrame(width=320, height=280)
35
    l1 = tkinter.Label(i, text="Blablabla")
36
    l1.grid()
37
    i.pack(fill=tkinter.BOTH, expand=1)
38
    tkinter.mainloop()
39