0
1
00:00:04,810 --> 00:00:06,170
<v ->Hello again, in this lesson</v>
1

2
00:00:06,170 --> 00:00:07,530
what we are going to do,
2

3
00:00:07,530 --> 00:00:09,710
by the way, this will be our last lesson,
3

4
00:00:09,710 --> 00:00:12,150
and we are going to finish our project.
4

5
00:00:12,150 --> 00:00:14,310
And in this lesson what I want to do,
5

6
00:00:14,310 --> 00:00:16,310
I want to create functions for
6

7
00:00:17,600 --> 00:00:20,010
show and hide Tool Bar and Status Bar.
7

8
00:00:20,010 --> 00:00:21,570
To that, what I need to do
8

9
00:00:21,570 --> 00:00:24,250
here I need to find my Tool Bar
9

10
00:00:25,190 --> 00:00:27,715
and Status Bar menu items, right.
10

11
00:00:27,715 --> 00:00:30,873
And they are somewhere here.
11

12
00:00:31,910 --> 00:00:35,490
Here, and I already created showStatusbar
12

13
00:00:35,490 --> 00:00:37,800
and showToolbar global variables.
13

14
00:00:37,800 --> 00:00:39,920
Also they are here, remember.
14

15
00:00:39,920 --> 00:00:41,047
And so what I need to do here,
15

16
00:00:41,047 --> 00:00:43,370
I need to create command properties
16

17
00:00:43,370 --> 00:00:45,165
for these guys, and I say
17

18
00:00:45,165 --> 00:00:49,964
command equals self.parent.,
18

19
00:00:49,964 --> 00:00:53,820
let's say hideToolbar, okay.
19

20
00:00:53,820 --> 00:00:56,370
and for other one, I will say again,
20

21
00:00:56,370 --> 00:01:01,123
comma and enter here command self.parent.
21

22
00:01:02,880 --> 00:01:05,350
Here let's say hideStatusbar,
22

23
00:01:07,360 --> 00:01:10,040
Status Bar okay.
23

24
00:01:10,040 --> 00:01:12,003
So first of all, what I need to do,
24

25
00:01:12,003 --> 00:01:14,660
I need to create these functions, right.
25

26
00:01:14,660 --> 00:01:17,020
And to create them, I will come here,
26

27
00:01:17,020 --> 00:01:19,020
end of my page, okay.
27

28
00:01:19,020 --> 00:01:22,627
It's here, and I will say def hideStatusbar
28

29
00:01:24,270 --> 00:01:28,510
self and asterisk arguments, right.
29

30
00:01:28,510 --> 00:01:32,090
And for this guy let's say pass, for now,
30

31
00:01:32,090 --> 00:01:35,980
and also let's create other one, and here I say
31

32
00:01:35,980 --> 00:01:39,573
def hideToolbar, like that, Okay.
32

33
00:01:44,100 --> 00:01:47,420
And self args okay.
33

34
00:01:47,420 --> 00:01:52,420
And here what I need to do, I come here and say
34

35
00:01:53,900 --> 00:01:56,520
first of all I do use here
35

36
00:01:56,520 --> 00:02:00,950
my global showToolbar, okay, and after here I will say
36

37
00:02:00,950 --> 00:02:04,210
if showToolbar equals equals True,
37

38
00:02:04,210 --> 00:02:07,238
and it's already True, by the way, remember,
38

39
00:02:07,238 --> 00:02:10,738
here I need to say self.toolbar.pack_forget.
39

40
00:02:13,414 --> 00:02:17,246
Okay, I will use this function to hide my toolbar,
40

41
00:02:17,246 --> 00:02:19,429
and after that here what I will say,
41

42
00:02:19,429 --> 00:02:22,346
showToolbar equals False now, okay.
42

43
00:02:23,454 --> 00:02:26,121
And if I run my application now,
43

44
00:02:29,436 --> 00:02:32,270
now it's here, Tool Bar is here.
44

45
00:02:32,270 --> 00:02:36,050
View, and Tool Bar, you see we hide our Tool Bar,
45

46
00:02:36,050 --> 00:02:39,620
and of course also we need to display it back,
46

47
00:02:39,620 --> 00:02:41,410
so how we can do that?
47

48
00:02:41,410 --> 00:02:43,500
To do that, here I will say,
48

49
00:02:43,500 --> 00:02:46,170
firstly I will show you something,
49

50
00:02:46,170 --> 00:02:49,595
I will say self dot, simply right,
50

51
00:02:49,595 --> 00:02:52,290
toolbar dot pack
51

52
00:02:53,900 --> 00:02:55,647
and here for pack, what I need to say,
52

53
00:02:55,647 --> 00:03:00,113
I need to say side equals TOP,
53

54
00:03:01,690 --> 00:03:06,259
and here, after that, I need to say fill equals X.
54

55
00:03:06,259 --> 00:03:10,562
Let's check our Tool Bar, what we've used already
55

56
00:03:10,562 --> 00:03:12,900
for pack geometry manager.
56

57
00:03:12,900 --> 00:03:15,896
Tool Bar main application is here, right,
57

58
00:03:15,896 --> 00:03:20,870
and not that one, sorry, it's here, Tool Bar,
58

59
00:03:20,870 --> 00:03:24,132
self.pack, side TOP, fill X.
59

60
00:03:24,132 --> 00:03:26,380
I'm going to use same properties, okay,
60

61
00:03:26,380 --> 00:03:29,420
for Tool Bar again, but you will  have a problem here.
61

62
00:03:29,420 --> 00:03:32,780
Let's run our application now first,
62

63
00:03:32,780 --> 00:03:35,079
and here what I need to say also, I need to say
63

64
00:03:35,079 --> 00:03:39,483
showToolbar equals False, right.
64

65
00:03:41,180 --> 00:03:42,713
If I run my application now,
65

66
00:03:45,370 --> 00:03:47,340
now here our Tool Bar is here.
66

67
00:03:47,340 --> 00:03:51,820
View Tool Bar, okay, so if I display it back,
67

68
00:03:51,820 --> 00:03:54,270
You see, I display it here, why is like that?
68

69
00:03:54,270 --> 00:03:58,457
Because when I hide my Tool Bar, and if I use here again
69

70
00:04:02,115 --> 00:04:05,581
if I display it, if I want to display it back here,
70

71
00:04:05,581 --> 00:04:09,360
I change order of my widgets, okay.
71

72
00:04:09,360 --> 00:04:12,912
And that's why here, let me run it again.
72

73
00:04:12,912 --> 00:04:17,050
Now the first, the Tool Bar was here,
73

74
00:04:17,050 --> 00:04:19,380
and after tool bad we have text editor,
74

75
00:04:19,380 --> 00:04:21,570
and after text editor we have Status Bar.
75

76
00:04:21,570 --> 00:04:23,940
Now we change order of our Tool Bar,
76

77
00:04:23,940 --> 00:04:25,746
and you see our Tool Bar here.
77

78
00:04:25,746 --> 00:04:28,760
So to solve this problem, what we need to do,
78

79
00:04:28,760 --> 00:04:33,500
here we need to say, before that,
79

80
00:04:33,500 --> 00:04:38,021
I will say here self.texteditor.pack_forget, okay.
80

81
00:04:38,021 --> 00:04:43,021
and also I need to say self.statusbar.pack_forget, okay.
81

82
00:04:45,720 --> 00:04:50,720
Now I will display my Tool Bar, and of that here
82

83
00:04:50,970 --> 00:04:54,460
again I will say self.texteditor.pack,
83

84
00:04:56,715 --> 00:04:58,520
dot pack, okay.
84

85
00:04:58,520 --> 00:05:03,520
and for pack I will say expand equals expand YES,
85

86
00:05:06,990 --> 00:05:08,823
and fill BOTH, okay.
86

87
00:05:12,460 --> 00:05:17,460
And for Status Bar, I need to say here self.statusbar.pack,
87

88
00:05:21,811 --> 00:05:24,203
I will say side equals BOTTOM.
88

89
00:05:25,890 --> 00:05:27,911
Now it will be fine, okay,
89

90
00:05:27,911 --> 00:05:32,911
and if I run my application again, run.
90

91
00:05:34,200 --> 00:05:36,763
Now View, Tool Bar, and let this right back,
91

92
00:05:39,400 --> 00:05:41,310
you see our Tool Bar is here.
92

93
00:05:41,310 --> 00:05:44,001
So for Status Bar what I need to do,
93

94
00:05:44,001 --> 00:05:47,857
here I will say global Statusbar,
94

95
00:05:50,590 --> 00:05:53,900
showStatusbar, sorry, showStatusbar,
95

96
00:05:53,900 --> 00:05:58,773
and if Statusbar, if showStatusbar equals equals True,
96

97
00:06:07,980 --> 00:06:09,200
and here what I need to say
97

98
00:06:09,200 --> 00:06:11,867
self.statusbar.pack_forget, right
98

99
00:06:15,610 --> 00:06:20,610
and I need to say showStatusbar equals False now.
99

100
00:06:22,331 --> 00:06:24,611
And for else what I need to say,
100

101
00:06:24,611 --> 00:06:29,611
else, and here I will say, self.statusbar.pack,
101

102
00:06:35,620 --> 00:06:40,057
and also what I will say here showStatusbar True,
102

103
00:06:42,570 --> 00:06:44,883
showStatusbar equals True.
103

104
00:06:46,270 --> 00:06:48,100
Why I don't do that for statusbar,
104

105
00:06:48,100 --> 00:06:50,300
because our Status Bar at bottom, okay,
105

106
00:06:50,300 --> 00:06:54,950
that's why we don't need to use for this pack forget,
106

107
00:06:54,950 --> 00:06:59,580
for text editor and also for Tool Bar, okay.
107

108
00:06:59,580 --> 00:07:01,720
Because it's already at bottom.
108

109
00:07:01,720 --> 00:07:03,420
Okay, if I run my application now,
109

110
00:07:06,390 --> 00:07:10,500
View, Status Bar, you see, and now check it again.
110

111
00:07:10,500 --> 00:07:13,290
Our Status Bar is here, our Tool Bar,
111

112
00:07:13,290 --> 00:07:15,470
and our Tool Bar now is here.
112

113
00:07:15,470 --> 00:07:20,310
This is how we can create our view menu for our application,
113

114
00:07:20,310 --> 00:07:23,353
for now that's all, actually we finished our project.
114

115
00:07:23,353 --> 00:07:25,610
I hope you enjoyed this project,
115

116
00:07:25,610 --> 00:07:28,650
and you learned many things, for now that's all.
116

117
00:07:28,650 --> 00:07:29,653
See you in the next.
