0
1
00:00:04,980 --> 00:00:06,250
<v Volkan Atis>Hello again, in previous lecture</v>
1

2
00:00:06,250 --> 00:00:09,070
what we did, let me run our application first.
2

3
00:00:09,070 --> 00:00:11,390
We created our functions for font family
3

4
00:00:11,390 --> 00:00:12,950
and also font size.
4

5
00:00:12,950 --> 00:00:14,510
And in this lesson, what I want to do,
5

6
00:00:14,510 --> 00:00:16,900
I want to create a function
6

7
00:00:16,900 --> 00:00:18,693
to make our text bold.
7

8
00:00:19,650 --> 00:00:21,170
What I need to do first of all,
8

9
00:00:21,170 --> 00:00:23,550
I need to go to my toolbar
9

10
00:00:23,550 --> 00:00:24,710
and find my button.
10

11
00:00:24,710 --> 00:00:27,590
My button is here, so here I will create
11

12
00:00:27,590 --> 00:00:29,560
a command property for my button first.
12

13
00:00:29,560 --> 00:00:30,510
I will say command,
13

14
00:00:32,350 --> 00:00:33,743
command equals,
14

15
00:00:34,850 --> 00:00:36,790
sorry command,
15

16
00:00:36,790 --> 00:00:38,430
yes is equals,
16

17
00:00:38,430 --> 00:00:40,430
I will say, self parent
17

18
00:00:41,330 --> 00:00:44,783
dot change bold.
18

19
00:00:46,020 --> 00:00:50,010
Parent means here my main application is here, that one.
19

20
00:00:50,010 --> 00:00:54,140
So I will create this function in my main class.
20

21
00:00:54,140 --> 00:00:56,770
Main application class here, I will come here,
21

22
00:00:56,770 --> 00:00:59,900
and create this function, I will say def
22

23
00:00:59,900 --> 00:01:00,943
change bold.
23

24
00:01:01,877 --> 00:01:06,050
And after self I will use args.
24

25
00:01:06,050 --> 00:01:07,230
It's parameter.
25

26
00:01:07,230 --> 00:01:08,500
And here what I need to do,
26

27
00:01:08,500 --> 00:01:11,813
if you want to change your text.
27

28
00:01:13,700 --> 00:01:16,550
First of all, we need to know our text properties.
28

29
00:01:16,550 --> 00:01:18,077
This is important.
29

30
00:01:18,077 --> 00:01:20,590
And how we can get our text properties,
30

31
00:01:20,590 --> 00:01:22,050
to that we need to create here.
31

32
00:01:22,050 --> 00:01:26,380
Let's create a variable font or text property.
32

33
00:01:26,380 --> 00:01:28,000
Let's say text.
33

34
00:01:28,000 --> 00:01:32,380
Text property or let's say text pro equals.
34

35
00:01:32,380 --> 00:01:34,070
I will say here font
35

36
00:01:34,070 --> 00:01:36,260
my function,
36

37
00:01:36,260 --> 00:01:38,173
after that, again, I need to say font.
37

38
00:01:39,170 --> 00:01:44,170
And here will say font equals my self dot text editor.
38

39
00:01:45,440 --> 00:01:49,420
And here I need to use square brackets and font.
39

40
00:01:49,420 --> 00:01:52,180
This guy, this function will return me
40

41
00:01:52,180 --> 00:01:54,620
text properties of text editor.
41

42
00:01:54,620 --> 00:01:57,590
But before that, what I need to do let's print it out,
42

43
00:01:57,590 --> 00:01:58,666
I need to use something else,
43

44
00:01:58,666 --> 00:02:02,749
I will say here, by the way, text pro dot actual,
44

45
00:02:04,071 --> 00:02:05,218
this function.
45

46
00:02:05,218 --> 00:02:07,551
Now if I run my application.
46

47
00:02:11,244 --> 00:02:12,827
Now we see it here.
47

48
00:02:15,466 --> 00:02:17,745
Here I will type something, this one,
48

49
00:02:17,745 --> 00:02:20,128
and if I click this bold button.
49

50
00:02:20,128 --> 00:02:21,128
Now, see it.
50

51
00:02:22,687 --> 00:02:25,385
You see here, this is my text properties
51

52
00:02:25,385 --> 00:02:28,950
and overstrike size is 10 pixels,
52

53
00:02:28,950 --> 00:02:30,363
weight is normal.
53

54
00:02:30,363 --> 00:02:32,090
Weight means here bold or not.
54

55
00:02:32,090 --> 00:02:35,230
If it is normal, that means our text is not bold.
55

56
00:02:35,230 --> 00:02:38,810
The family and slant, and also underline.
56

57
00:02:38,810 --> 00:02:41,870
Underline for zero means it is not underline.
57

58
00:02:41,870 --> 00:02:43,077
It doesn't have underline.
58

59
00:02:43,077 --> 00:02:45,550
If it value is one, that means our text
59

60
00:02:45,550 --> 00:02:47,735
is already underlined.
60

61
00:02:47,735 --> 00:02:48,660
It's important.
61

62
00:02:48,660 --> 00:02:51,850
So here, for the weight, what I need to say,
62

63
00:02:51,850 --> 00:02:54,820
if you want to learn weight of your font,
63

64
00:02:54,820 --> 00:02:56,060
if it is bold or not,
64

65
00:02:56,060 --> 00:02:58,766
you need to say here weight, simply.
65

66
00:02:58,766 --> 00:03:00,953
And now if I run my application again.
66

67
00:03:02,980 --> 00:03:04,790
Now I will close this one,
67

68
00:03:04,790 --> 00:03:09,180
and for the weight why it didn't return me here.
68

69
00:03:09,180 --> 00:03:12,743
Print text pro actual weight, I said.
69

70
00:03:16,344 --> 00:03:19,220
Oh, I didn't press my button, sorry.
70

71
00:03:19,220 --> 00:03:22,570
So here, I press my button,
71

72
00:03:22,570 --> 00:03:23,720
and now close it.
72

73
00:03:23,720 --> 00:03:25,470
You see, it said normal.
73

74
00:03:25,470 --> 00:03:28,510
That means my text is not bold.
74

75
00:03:28,510 --> 00:03:30,970
So how can I change my...
75

76
00:03:30,970 --> 00:03:33,730
How can I make my text bold,
76

77
00:03:33,730 --> 00:03:36,363
I will say here if font,
77

78
00:03:37,310 --> 00:03:38,860
sorry, text property
78

79
00:03:41,101 --> 00:03:44,540
text property actual
79

80
00:03:44,540 --> 00:03:45,830
and here I will say
80

81
00:03:45,830 --> 00:03:47,610
I will use weight.
81

82
00:03:47,610 --> 00:03:48,443
Weight
82

83
00:03:51,720 --> 00:03:53,060
equals equals
83

84
00:03:54,190 --> 00:03:55,370
let's use here
84

85
00:03:56,410 --> 00:03:58,593
bold, or sorry, normal.
85

86
00:03:59,660 --> 00:04:03,331
Normal, that means I can make it bold.
86

87
00:04:03,331 --> 00:04:06,270
And I will say here self dot text editor
87

88
00:04:07,380 --> 00:04:08,980
configure, I will say,
88

89
00:04:08,980 --> 00:04:10,930
and for the font,
89

90
00:04:10,930 --> 00:04:13,460
I will say font family
90

91
00:04:13,460 --> 00:04:15,173
is my font family will be.
91

92
00:04:16,020 --> 00:04:18,490
Font size will be my font size.
92

93
00:04:18,490 --> 00:04:21,800
I already defined font size and font family, by the way.
93

94
00:04:21,800 --> 00:04:23,250
And here,
94

95
00:04:23,250 --> 00:04:25,020
for the bold, I will say
95

96
00:04:28,310 --> 00:04:29,820
bold.
96

97
00:04:29,820 --> 00:04:32,020
If it is normal, I will make it bold.
97

98
00:04:32,020 --> 00:04:36,650
If not, I will say elif here.
98

99
00:04:36,650 --> 00:04:39,003
And for elif, what I will say here,
99

100
00:04:41,030 --> 00:04:42,930
I can copy this guy
100

101
00:04:42,930 --> 00:04:44,003
and paste it here,
101

102
00:04:45,080 --> 00:04:46,573
and if it is bold.
102

103
00:04:48,770 --> 00:04:50,770
And I will copy this guy
103

104
00:04:53,930 --> 00:04:55,433
and here I will say font
104

105
00:04:55,433 --> 00:04:58,913
after font size it will be normal,
105

106
00:04:58,913 --> 00:04:59,869
not bold.
106

107
00:04:59,869 --> 00:05:02,683
Now if I run my application again.
107

108
00:05:02,683 --> 00:05:03,850
Now it's here.
108

109
00:05:04,736 --> 00:05:07,607
If I press bold, you see now our text is bold.
109

110
00:05:07,607 --> 00:05:10,850
If I press it again, you see it is not,
110

111
00:05:10,850 --> 00:05:11,980
now it's normal.
111

112
00:05:11,980 --> 00:05:13,360
Bold and normal.
112

113
00:05:13,360 --> 00:05:16,960
And this is how we can create our bold function
113

114
00:05:16,960 --> 00:05:18,620
for our text editor.
114

115
00:05:18,620 --> 00:05:19,940
For now that's all.
115

116
00:05:19,940 --> 00:05:20,963
See you in the next.
