0
1
00:00:05,010 --> 00:00:06,440
<v Volkan>Hello, in our previous lecture we</v>
1

2
00:00:06,440 --> 00:00:09,720
did, we created our function to make our text
2

3
00:00:09,720 --> 00:00:12,020
bold, right? And in this lesson what I want
3

4
00:00:12,020 --> 00:00:15,054
to do, I want to create my function for
4

5
00:00:15,054 --> 00:00:17,536
italic, okay? The italic button is here.
5

6
00:00:17,536 --> 00:00:21,100
So first of all, what we need to do, like before
6

7
00:00:21,100 --> 00:00:23,270
we need to go to find this button, right?
7

8
00:00:23,270 --> 00:00:26,075
And italic is here. And now what I need to do,
8

9
00:00:26,075 --> 00:00:28,573
I will create command property,
9

10
00:00:29,421 --> 00:00:32,400
and I will say here, self dot parent
10

11
00:00:33,320 --> 00:00:37,570
dot change italic, okay?
11

12
00:00:37,570 --> 00:00:42,000
And after that I will create this function here under...
12

13
00:00:43,530 --> 00:00:45,320
Change bold, okay?
13

14
00:00:45,320 --> 00:00:47,440
And here, what I will say, I say
14

15
00:00:47,440 --> 00:00:49,949
def, change italic and here self
15

16
00:00:49,949 --> 00:00:53,203
and again args, okay?
16

17
00:00:54,110 --> 00:00:57,750
So what I need to do now, here, it is very similar
17

18
00:00:57,750 --> 00:01:01,374
actually, we will create, we will do very similar things
18

19
00:01:01,374 --> 00:01:03,910
okay? And here what I need to say,
19

20
00:01:03,910 --> 00:01:06,530
I need to say here text...
20

21
00:01:08,580 --> 00:01:11,201
Property, I will say text pro
21

22
00:01:11,201 --> 00:01:13,830
equals font dot...
22

23
00:01:15,220 --> 00:01:16,900
font, right?
23

24
00:01:16,900 --> 00:01:20,230
And here again I will say font equals
24

25
00:01:20,230 --> 00:01:23,300
self dot text editor...
25

26
00:01:23,300 --> 00:01:25,520
and font, right?
26

27
00:01:25,520 --> 00:01:30,042
And again I will print out here, print, text pro
27

28
00:01:30,042 --> 00:01:32,722
dot actual, okay? This function.
28

29
00:01:32,722 --> 00:01:35,890
Now, why am I printing it out again? Because I want
29

30
00:01:35,890 --> 00:01:39,000
to show you something here. Here, when I
30

31
00:01:39,000 --> 00:01:43,174
click this button, okay? Now let's see it here.
31

32
00:01:43,174 --> 00:01:47,010
Here you see is the weight is normal, okay? That means
32

33
00:01:47,010 --> 00:01:49,925
it's not bold, size, underline, zero. Slant, so
33

34
00:01:49,925 --> 00:01:53,980
here we have our italic making, italic is here, we need
34

35
00:01:53,980 --> 00:01:56,287
to talk about slant and roman, okay?
35

36
00:01:56,287 --> 00:01:58,512
If slant equals roman that
36

37
00:01:58,512 --> 00:02:02,550
means our text is not italic, okay?
37

38
00:02:02,550 --> 00:02:04,100
If slant is...
38

39
00:02:05,380 --> 00:02:06,840
equals italic that means
39

40
00:02:06,840 --> 00:02:10,961
our text is italic, okay? So here what I need to do,
40

41
00:02:10,961 --> 00:02:14,540
I need to come here and say...
41

42
00:02:15,890 --> 00:02:16,723
If,
42

43
00:02:18,130 --> 00:02:21,550
text pro dot actual,
43

44
00:02:21,550 --> 00:02:24,913
and here I will slant, alright? Slant property.
44

45
00:02:24,913 --> 00:02:28,965
Equals, equals, I will say roman,
45

46
00:02:28,965 --> 00:02:32,180
that means my text is not italic, right?
46

47
00:02:32,180 --> 00:02:33,569
And I will say here self dot
47

48
00:02:33,569 --> 00:02:37,323
text editor dot configure,
48

49
00:02:38,520 --> 00:02:39,850
and for the font I will say
49

50
00:02:39,850 --> 00:02:43,616
font equals font family...
50

51
00:02:43,616 --> 00:02:45,750
font size...
51

52
00:02:45,750 --> 00:02:50,159
and this time I will make it italic, okay?
52

53
00:02:50,159 --> 00:02:54,281
Italic. Okay, for the other option I will say
53

54
00:02:54,281 --> 00:02:58,730
elif, of course, and here I will say...
54

55
00:02:58,730 --> 00:03:03,413
text property dot actual and again, slant.
55

56
00:03:08,060 --> 00:03:10,800
Equals, equals, I will say, let me...
56

57
00:03:10,800 --> 00:03:14,770
Here, press enter again. Slant, equals, equals.
57

58
00:03:14,770 --> 00:03:17,560
Now, italic, okay?
58

59
00:03:17,560 --> 00:03:19,170
I will make it normal.
59

60
00:03:19,170 --> 00:03:21,630
That means I will make it roman, actually.
60

61
00:03:21,630 --> 00:03:25,670
Here I will say, self dot text editor dot configure
61

62
00:03:25,670 --> 00:03:30,483
font equals parenthesis font family,
62

63
00:03:31,850 --> 00:03:35,570
font family first, properties.
63

64
00:03:35,570 --> 00:03:38,823
And other one is font size and other one will be
64

65
00:03:38,823 --> 00:03:43,140
roman, okay? Now if I run my application...
65

66
00:03:46,290 --> 00:03:49,562
Here, our editor is here, now I will press
66

67
00:03:49,562 --> 00:03:52,080
this button, you see now it's italic.
67

68
00:03:52,080 --> 00:03:55,272
If I press it again you see it's normal now.
68

69
00:03:55,272 --> 00:03:59,250
Italic and normal. Italic and normal.
69

70
00:03:59,250 --> 00:04:01,810
This is how we can create our italic function
70

71
00:04:01,810 --> 00:04:04,080
for our text editor, for now that's all,
71

72
00:04:04,080 --> 00:04:05,080
see you in the next.
