0
1
00:00:04,713 --> 00:00:05,546
<v Instructor>Hello again.</v>
1

2
00:00:05,546 --> 00:00:06,916
In this lesson we are going to create
2

3
00:00:06,916 --> 00:00:09,540
our display person window.
3

4
00:00:09,540 --> 00:00:11,489
Let me run our application first.
4

5
00:00:11,489 --> 00:00:16,475
Here, what we have, we already created two buttons right?
5

6
00:00:16,475 --> 00:00:19,543
Two for add and also for update.
6

7
00:00:19,543 --> 00:00:23,351
We create our functions and also our page, right?
7

8
00:00:23,351 --> 00:00:26,686
Now it's time to create our display button.
8

9
00:00:26,686 --> 00:00:28,559
The window of display button.
9

10
00:00:28,559 --> 00:00:29,566
So how we can do that?
10

11
00:00:29,566 --> 00:00:30,645
It's very similar actually.
11

12
00:00:30,645 --> 00:00:32,789
It's like update, but we will not update it.
12

13
00:00:32,789 --> 00:00:34,290
We will only display it.
13

14
00:00:34,290 --> 00:00:36,965
So, what I need to do here?
14

15
00:00:36,965 --> 00:00:39,411
I will come my people and here.
15

16
00:00:39,411 --> 00:00:42,516
I need to find my button first.
16

17
00:00:42,516 --> 00:00:43,903
Btndisplay right?
17

18
00:00:43,903 --> 00:00:44,736
It's here.
18

19
00:00:45,655 --> 00:00:46,601
And here what I will say?
19

20
00:00:46,601 --> 00:00:50,618
I will say command is equal to funcDisplayPerson.
20

21
00:00:50,618 --> 00:00:54,701
I will say command is equal to funcDisplayPerson.
21

22
00:00:57,660 --> 00:00:58,493
What we need to do?
22

23
00:00:58,493 --> 00:00:59,526
We need to use here self.
23

24
00:00:59,526 --> 00:01:02,209
Self.funcDisplayPerson.
24

25
00:01:02,209 --> 00:01:03,042
Okay!
25

26
00:01:03,042 --> 00:01:06,542
So I will copy this name and come here.
26

27
00:01:09,342 --> 00:01:10,212
Actually here.
27

28
00:01:10,212 --> 00:01:11,879
Create our function.
28

29
00:01:13,227 --> 00:01:15,612
Def funcDisplayPerson, right?
29

30
00:01:15,612 --> 00:01:17,734
Def funcDisplayPerson, right?
30

31
00:01:17,734 --> 00:01:20,120
And here what I need to do?
31

32
00:01:20,120 --> 00:01:21,486
I will say here.
32

33
00:01:21,486 --> 00:01:24,537
Again I need to use global person_id.
33

34
00:01:24,537 --> 00:01:27,397
Again I need to use global person_id.
34

35
00:01:27,397 --> 00:01:28,932
And after that here what I need to do?
35

36
00:01:28,932 --> 00:01:33,501
I need to say selected_item like update person is equal to
36

37
00:01:33,501 --> 00:01:37,478
I need to say selected_item like update person is equal to
37

38
00:01:37,478 --> 00:01:40,106
self.listBox.curselection, okay?
38

39
00:01:40,106 --> 00:01:43,569
self.listBox.curselection, okay?
39

40
00:01:43,569 --> 00:01:47,452
And after that, person is equal to self.listBox.get.
40

41
00:01:47,452 --> 00:01:51,369
And after, person is equal to self.listBox.get.
41

42
00:01:52,278 --> 00:01:56,116
And here I will pass in selected_item.
42

43
00:01:56,116 --> 00:01:57,435
And what is next?
43

44
00:01:57,435 --> 00:02:01,087
Now I need to get my ID, like here.
44

45
00:02:01,087 --> 00:02:03,949
Everything is very similar actually.
45

46
00:02:03,949 --> 00:02:08,682
Again I need to say here person_id is equal to person.split.
46

47
00:02:08,682 --> 00:02:13,515
Again I need to say here person_id is equal to person.split.
47

48
00:02:14,614 --> 00:02:16,896
I will split by, again dash.
48

49
00:02:16,896 --> 00:02:19,187
I will split by, again dash.
49

50
00:02:19,187 --> 00:02:20,020
What I need to do?
50

51
00:02:20,020 --> 00:02:22,920
I need to get first index.
51

52
00:02:22,920 --> 00:02:23,837
It is zero.
52

53
00:02:24,781 --> 00:02:29,531
And after that, here, I will create my instance from my class.
53

54
00:02:30,425 --> 00:02:34,056
So I will say display page is equal to display class.
54

55
00:02:34,056 --> 00:02:38,473
So I will say display page is equal to display class.
55

56
00:02:39,761 --> 00:02:41,677
We didn't create this class yet.
56

57
00:02:41,677 --> 00:02:43,594
I will go to create it.
57

58
00:02:45,151 --> 00:02:48,984
And here I want to say again self.destroy.
58

59
00:02:48,984 --> 00:02:50,067
Self.destroy.
59

60
00:02:52,207 --> 00:02:53,457
So what I need to do now?
60

61
00:02:53,457 --> 00:02:56,957
I need to go and create this class, right?
61

62
00:02:57,949 --> 00:02:59,406
And it will be very similar.
62

63
00:02:59,406 --> 00:03:00,387
Like this one.
63

64
00:03:00,387 --> 00:03:02,502
Actually I think is very very similar.
64

65
00:03:02,502 --> 00:03:04,149
So what we need to do?
65

66
00:03:04,149 --> 00:03:05,487
Let's go to there.
66

67
00:03:05,487 --> 00:03:07,074
Here, somewhere.
67

68
00:03:07,074 --> 00:03:09,157
I will say class Display.
68

69
00:03:11,888 --> 00:03:15,742
And here, I will inherit it from TopLevel.
69

70
00:03:15,742 --> 00:03:19,185
And after that I need to say def __init__.
70

71
00:03:19,185 --> 00:03:23,499
And after that I need to day def __init__.
71

72
00:03:23,499 --> 00:03:24,893
After that what I need to use?
72

73
00:03:24,893 --> 00:03:27,512
I need to say TopLevel.__init__.
73

74
00:03:27,512 --> 00:03:30,140
I need to say TopLevel.__init__.
74

75
00:03:30,140 --> 00:03:31,504
I need to say TopLevel.__init__.
75

76
00:03:31,504 --> 00:03:33,412
And here I need to use self.
76

77
00:03:33,412 --> 00:03:36,498
And again now, need to define our geometry,
77

78
00:03:36,498 --> 00:03:38,325
title and resizeable.
78

79
00:03:38,325 --> 00:03:39,333
Like before.
79

80
00:03:39,333 --> 00:03:40,728
So, self.geometry.
80

81
00:03:40,728 --> 00:03:42,418
So, self.geometry.
81

82
00:03:42,418 --> 00:03:45,551
For geometry, 650x750+550+200.
82

83
00:03:45,551 --> 00:03:48,811
For geometry, 650x750+550+200.
83

84
00:03:48,811 --> 00:03:52,484
For geometry, 650x750+550+200.
84

85
00:03:52,484 --> 00:03:55,207
For title, I will say self.title.
85

86
00:03:55,207 --> 00:03:57,957
For title, I will say self.title.
86

87
00:03:58,992 --> 00:03:59,909
Self.title.
87

88
00:04:03,208 --> 00:04:04,129
Self.title.
88

89
00:04:04,129 --> 00:04:06,036
will be display person.
89

90
00:04:06,036 --> 00:04:07,860
will be display person.
90

91
00:04:07,860 --> 00:04:09,777
will be display person.
91

92
00:04:11,132 --> 00:04:12,446
And also what I will use?
92

93
00:04:12,446 --> 00:04:16,132
I will say self.resizable is false and false.
93

94
00:04:16,132 --> 00:04:20,585
I will say self.resizable is false and false.
94

95
00:04:20,585 --> 00:04:21,418
It's okay.
95

96
00:04:21,418 --> 00:04:23,158
Now we created our window.
96

97
00:04:23,158 --> 00:04:26,074
Now if I run my application...
97

98
00:04:26,074 --> 00:04:27,311
Main, right?
98

99
00:04:27,311 --> 00:04:28,144
And run.
99

100
00:04:29,625 --> 00:04:30,615
My people.
100

101
00:04:30,615 --> 00:04:33,039
For example, let's display David.
101

102
00:04:33,039 --> 00:04:34,025
Display.
102

103
00:04:34,025 --> 00:04:35,793
As you see now, our window is here
103

104
00:04:35,793 --> 00:04:37,684
and we destroyed the other one.
104

105
00:04:37,684 --> 00:04:38,974
So what I need to do now?
105

106
00:04:38,974 --> 00:04:40,991
I need to create my design.
106

107
00:04:40,991 --> 00:04:42,790
For design what I need to do?
107

108
00:04:42,790 --> 00:04:46,596
Actually I will copy these guys, okay?
108

109
00:04:46,596 --> 00:04:50,253
From class not application, sorry.
109

110
00:04:50,253 --> 00:04:51,369
Here.
110

111
00:04:51,369 --> 00:04:53,051
I will copy this.
111

112
00:04:53,051 --> 00:04:54,134
Update, okay?
112

113
00:04:55,753 --> 00:04:56,586
And here.
113

114
00:04:58,052 --> 00:05:00,517
Everything is very similar.
114

115
00:05:00,517 --> 00:05:04,292
We will change somethings, not much.
115

116
00:05:04,292 --> 00:05:07,012
So we will not update our person, only will display it.
116

117
00:05:07,012 --> 00:05:10,331
So we don't need this function.
117

118
00:05:10,331 --> 00:05:13,164
I will copy this and come here.
118

119
00:05:14,220 --> 00:05:15,720
And paste it here.
119

120
00:05:17,523 --> 00:05:19,646
And now let's remove this one.
120

121
00:05:19,646 --> 00:05:21,598
We don't need button here, okay?
121

122
00:05:21,598 --> 00:05:23,681
Let's remove all of them.
122

123
00:05:25,296 --> 00:05:26,796
And now it's fine.
123

124
00:05:29,302 --> 00:05:31,078
This is also okay.
124

125
00:05:31,078 --> 00:05:34,206
And we'll get the person from database, right?
125

126
00:05:34,206 --> 00:05:35,459
It's here.
126

127
00:05:35,459 --> 00:05:36,825
But here what I want to do?
127

128
00:05:36,825 --> 00:05:39,575
Let me run our application first.
128

129
00:05:40,793 --> 00:05:42,297
My people.
129

130
00:05:42,297 --> 00:05:43,130
David.
130

131
00:05:43,130 --> 00:05:43,963
Update, right?
131

132
00:05:43,963 --> 00:05:44,940
It's here.
132

133
00:05:44,940 --> 00:05:46,319
David, Blue, and everything it's here.
133

134
00:05:46,319 --> 00:05:49,903
But I will use here for entries and for my text editor.
134

135
00:05:49,903 --> 00:05:52,296
But I will use here for entries and for my text editor.
135

136
00:05:52,296 --> 00:05:55,033
State is equal to disabled, okay?
136

137
00:05:55,033 --> 00:05:58,096
State is equal to disabled, okay?
137

138
00:05:58,096 --> 00:05:59,346
I don't want...
138

139
00:06:00,205 --> 00:06:01,885
Now they are editable, right?
139

140
00:06:01,885 --> 00:06:04,118
These values, you see?
140

141
00:06:04,118 --> 00:06:06,498
I want to solve this problem.
141

142
00:06:06,498 --> 00:06:07,960
So what I will do?
142

143
00:06:07,960 --> 00:06:11,030
Here I will go to find my entries.
143

144
00:06:11,030 --> 00:06:13,468
My entries is the first button
144

145
00:06:13,468 --> 00:06:15,114
This is not here, sorry.
145

146
00:06:15,114 --> 00:06:16,337
It's here.
146

147
00:06:16,337 --> 00:06:17,932
So my entries it's here, right?
147

148
00:06:17,932 --> 00:06:21,561
For the name, I will say here self.ent_name.
148

149
00:06:21,561 --> 00:06:25,702
For the name, I will say here self.ent_name.
149

150
00:06:25,702 --> 00:06:28,258
Here, for disabled, what do we need to use?
150

151
00:06:28,258 --> 00:06:30,427
We need to use state, right?
151

152
00:06:30,427 --> 00:06:31,260
Sorry!
152

153
00:06:31,260 --> 00:06:32,093
Config.
153

154
00:06:33,199 --> 00:06:37,282
And for config we say state is equal to disabled.
154

155
00:06:42,619 --> 00:06:45,434
Now if I run my application...
155

156
00:06:45,434 --> 00:06:47,178
Something wrong here.
156

157
00:06:47,178 --> 00:06:48,261
Let me check.
157

158
00:06:52,427 --> 00:06:53,260
Config.
158

159
00:06:53,260 --> 00:06:54,272
This is okay.
159

160
00:06:54,272 --> 00:06:56,358
Yeah, now it's fine.
160

161
00:06:56,358 --> 00:06:57,969
Let me run our application.
161

162
00:06:57,969 --> 00:06:58,859
For name.
162

163
00:06:58,859 --> 00:06:59,692
Now David.
163

164
00:06:59,692 --> 00:07:00,921
Now David.
164

165
00:07:00,921 --> 00:07:02,028
Display.
165

166
00:07:02,028 --> 00:07:04,611
As you see now, we cannot edit this area, okay?
166

167
00:07:04,611 --> 00:07:07,604
This first entry box, okay?
167

168
00:07:07,604 --> 00:07:11,104
Also, we need to do same thing for others.
168

169
00:07:12,609 --> 00:07:14,859
For others what I will say?
169

170
00:07:16,429 --> 00:07:21,008
Here, my people and surname will be self.ent_surname.config.
170

171
00:07:21,008 --> 00:07:25,834
Here, my people and surname will be self.ent_surname.config.
171

172
00:07:25,834 --> 00:07:28,003
And state will be disabled.
172

173
00:07:28,003 --> 00:07:30,253
And state will be disabled.
173

174
00:07:32,440 --> 00:07:34,023
And for email also.
174

175
00:07:35,725 --> 00:07:37,538
Self.ent_email.config.
175

176
00:07:37,538 --> 00:07:39,329
Self.ent_email.config.
176

177
00:07:39,329 --> 00:07:41,619
Self.ent_email.config.
177

178
00:07:41,619 --> 00:07:43,654
State is equal to disabled.
178

179
00:07:43,654 --> 00:07:45,671
State is equal to disabled.
179

180
00:07:45,671 --> 00:07:48,519
State is equal to disabled.
180

181
00:07:48,519 --> 00:07:51,769
You know we can copy this thing, right?
181

182
00:07:52,621 --> 00:07:56,954
And here for phone number I will say self.ent_phone.
182

183
00:07:59,494 --> 00:08:01,806
State is equal to default.
183

184
00:08:01,806 --> 00:08:04,873
But before text editor what you need to do?
184

185
00:08:04,873 --> 00:08:06,706
You need to come here.
185

186
00:08:08,156 --> 00:08:11,428
And here I will say self.address.config.
186

187
00:08:11,428 --> 00:08:14,177
And here I will say self.address.config.
187

188
00:08:14,177 --> 00:08:15,985
And here we need to say.
188

189
00:08:15,985 --> 00:08:18,031
Actually it's also same thing.
189

190
00:08:18,031 --> 00:08:20,128
State is equal to disabled.
190

191
00:08:20,128 --> 00:08:22,378
State is equal to disabled.
191

192
00:08:23,607 --> 00:08:24,536
Okay?
192

193
00:08:24,536 --> 00:08:26,234
Now we are done.
193

194
00:08:26,234 --> 00:08:28,567
If I run my application now.
194

195
00:08:30,841 --> 00:08:31,674
Run.
195

196
00:08:32,569 --> 00:08:33,402
My People.
196

197
00:08:36,835 --> 00:08:37,834
Display.
197

198
00:08:37,834 --> 00:08:40,139
As you see now, all of them is disabled.
198

199
00:08:40,139 --> 00:08:44,334
And now here even we cannot change this address value.
199

200
00:08:44,334 --> 00:08:47,522
This is how we can display our persons.
200

201
00:08:47,522 --> 00:08:48,456
For now that's all.
201

202
00:08:48,456 --> 00:08:50,123
See you in the next!
