0
1
00:00:04,560 --> 00:00:05,800
<v Volkan>Hello again, in previous lectures</v>
1

2
00:00:05,800 --> 00:00:06,853
we displayed our statistics.
2

3
00:00:08,464 --> 00:00:10,046
It's here.
3

4
00:00:10,046 --> 00:00:12,033
In this lecture what I want to do,
4

5
00:00:12,033 --> 00:00:14,143
when I add new book.
5

6
00:00:15,100 --> 00:00:17,586
Lets say, new book.
6

7
00:00:17,586 --> 00:00:18,720
Add book.
7

8
00:00:18,720 --> 00:00:20,240
(digital chime)
8

9
00:00:20,240 --> 00:00:23,460
Now my book, I can't display it here,
9

10
00:00:23,460 --> 00:00:25,180
but if I go to statistic, as you see
10

11
00:00:25,180 --> 00:00:27,540
it was 10 now it's 11.
11

12
00:00:27,540 --> 00:00:29,900
And also I want to display my book,
12

13
00:00:29,900 --> 00:00:31,650
at my list.
13

14
00:00:31,650 --> 00:00:33,010
How can I do that?
14

15
00:00:33,010 --> 00:00:36,383
To do that, actually there are some ways to do that.
15

16
00:00:37,760 --> 00:00:39,720
The first way we already used,
16

17
00:00:39,720 --> 00:00:42,210
it is notebook tab changed.
17

18
00:00:42,210 --> 00:00:45,720
And also, I can use another function,
18

19
00:00:45,720 --> 00:00:46,553
let me show you.
19

20
00:00:46,553 --> 00:00:47,386
Self dot
20

21
00:00:49,430 --> 00:00:51,000
tabs
21

22
00:00:51,000 --> 00:00:51,833
dot
22

23
00:00:51,833 --> 00:00:53,380
bind method again.
23

24
00:00:53,380 --> 00:00:55,000
And here I can say
24

25
00:00:56,270 --> 00:00:57,103
button
25

26
00:00:58,620 --> 00:01:00,110
release
26

27
00:01:00,110 --> 00:01:01,190
dash
27

28
00:01:01,190 --> 00:01:02,440
one
28

29
00:01:02,440 --> 00:01:05,720
and here I can say display book.
29

30
00:01:07,812 --> 00:01:10,410
(keyboard strokes)
30

31
00:01:10,410 --> 00:01:12,810
Display books.
31

32
00:01:12,810 --> 00:01:15,730
Okay, this is the second way I can do that,
32

33
00:01:15,730 --> 00:01:17,273
for my display books.
33

34
00:01:20,430 --> 00:01:24,437
But here you might think why we cannot use
34

35
00:01:24,437 --> 00:01:26,483
this function for both,
35

36
00:01:27,630 --> 00:01:29,770
notebook tab changed bind method,
36

37
00:01:29,770 --> 00:01:31,010
for both function.
37

38
00:01:31,010 --> 00:01:32,380
Actually we cannot do that
38

39
00:01:32,380 --> 00:01:35,980
and also I will not use this function too.
39

40
00:01:35,980 --> 00:01:39,160
Because the recommended way is only creating
40

41
00:01:39,160 --> 00:01:41,300
one function, instead of display books
41

42
00:01:41,300 --> 00:01:43,668
and display status, okay.
42

43
00:01:43,668 --> 00:01:46,110
We can create only one function, for example
43

44
00:01:46,110 --> 00:01:48,010
the functioning can be display
44

45
00:01:48,010 --> 00:01:52,770
and the old display function can contain everything
45

46
00:01:52,770 --> 00:01:56,120
from display books and also display statistics.
46

47
00:01:56,120 --> 00:01:59,030
This is the best way and recommended way we should do that.
47

48
00:01:59,030 --> 00:02:01,590
Or second way we can do that for our display book.
48

49
00:02:01,590 --> 00:02:04,380
And the last one we can come here
49

50
00:02:04,380 --> 00:02:07,903
and call our display books function.
50

51
00:02:10,000 --> 00:02:13,100
Also this will solve our problem.
51

52
00:02:13,100 --> 00:02:15,040
This way it looks easier
52

53
00:02:15,040 --> 00:02:16,910
but actually if you have many functions
53

54
00:02:16,910 --> 00:02:18,500
this way is not easier way, okay.
54

55
00:02:18,500 --> 00:02:20,430
This way is not Pythonic way.
55

56
00:02:20,430 --> 00:02:23,680
But in this case I will do that, okay.
56

57
00:02:23,680 --> 00:02:27,370
But as I said I recommend creating one function,
57

58
00:02:27,370 --> 00:02:30,170
instead of these two functions.
58

59
00:02:30,170 --> 00:02:33,550
And we can call here, the function,
59

60
00:02:33,550 --> 00:02:36,730
notebook tab changed and we will solve all the problems.
60

61
00:02:36,730 --> 00:02:40,170
For example if you have 10, or more than 10 functions,
61

62
00:02:40,170 --> 00:02:42,670
we should use this way, okay.
62

63
00:02:42,670 --> 00:02:44,270
Notebook, tab self bind.
63

64
00:02:44,270 --> 00:02:46,330
Notebook tab changed, okay.
64

65
00:02:46,330 --> 00:02:50,150
And after that, here let me run our application,
65

66
00:02:50,150 --> 00:02:52,680
and see everything works or not.
66

67
00:02:52,680 --> 00:02:54,713
Now, so here I have 11 books.
67

68
00:02:55,600 --> 00:02:57,630
And if I add new one.
68

69
00:02:57,630 --> 00:02:58,463
Add book.
69

70
00:02:58,463 --> 00:02:59,296
(digital chime)
70

71
00:02:59,296 --> 00:03:00,963
Now 11 it was.
71

72
00:03:00,963 --> 00:03:02,370
12, right?
72

73
00:03:02,370 --> 00:03:04,550
But if I go back to here, you see now
73

74
00:03:04,550 --> 00:03:06,460
here there is another problem.
74

75
00:03:06,460 --> 00:03:09,610
Now we have 10, 11, 12, it's here.
75

76
00:03:09,610 --> 00:03:12,230
But again we have 11 books here,
76

77
00:03:12,230 --> 00:03:14,540
so how can I solve this problem?
77

78
00:03:14,540 --> 00:03:16,850
To do that I need to come here,
78

79
00:03:16,850 --> 00:03:18,100
and display books.
79

80
00:03:18,100 --> 00:03:20,380
Before for loop.
80

81
00:03:20,380 --> 00:03:22,300
Before for loop, what I need to,
81

82
00:03:22,300 --> 00:03:25,440
I need to delete old values from my list.
82

83
00:03:25,440 --> 00:03:27,730
Self dot list books
83

84
00:03:28,670 --> 00:03:30,490
dot delete, okay.
84

85
00:03:30,490 --> 00:03:35,490
And I will say, from first character until end, okay.
85

86
00:03:35,660 --> 00:03:37,993
And now, if I run it again.
86

87
00:03:40,700 --> 00:03:42,420
Now we have 12.
87

88
00:03:42,420 --> 00:03:44,130
So if I add new one:
88

89
00:03:44,130 --> 00:03:45,692
add book, and-
89

90
00:03:45,692 --> 00:03:46,860
(digital chime)
90

91
00:03:46,860 --> 00:03:47,693
Okay.
91

92
00:03:47,693 --> 00:03:50,640
Now if I go back to statistics,
92

93
00:03:50,640 --> 00:03:52,530
13 books in library.
93

94
00:03:52,530 --> 00:03:53,363
Great.
94

95
00:03:53,363 --> 00:03:55,230
So if I come back to here, as you see now,
95

96
00:03:56,220 --> 00:03:58,180
the last book is also here.
96

97
00:03:58,180 --> 00:04:01,080
This is how we can update our list box.
97

98
00:04:01,080 --> 00:04:01,913
For now, that's all.
98

99
00:04:01,913 --> 00:04:02,973
See you in the next.
