CustomFrame.informHeight()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
dl 0
loc 2
rs 10
c 1
b 0
f 0
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