0
1
00:00:05,298 --> 00:00:06,570
<v Volkan>In this lecture, we are going to learn</v>
1

2
00:00:06,570 --> 00:00:10,570
how we can add stylish themes to our GUI applications.
2

3
00:00:10,570 --> 00:00:15,570
And actually, Tkinter already has a style widget,
3

4
00:00:15,600 --> 00:00:18,600
but it is not..., it doesn't have a modern looking,
4

5
00:00:18,600 --> 00:00:21,822
That's why I want to show you another option.
5

6
00:00:21,822 --> 00:00:22,655
To that what we need to do,
6

7
00:00:22,655 --> 00:00:24,650
by the way, I already created our application.
7

8
00:00:24,650 --> 00:00:25,900
Let me run it.
8

9
00:00:25,900 --> 00:00:29,000
Now we will apply this theme
9

10
00:00:29,000 --> 00:00:33,140
for this GUI application, it's for our application,
10

11
00:00:33,140 --> 00:00:34,800
To do that what we need to do?
11

12
00:00:34,800 --> 00:00:36,350
We need to instal a new package
12

13
00:00:36,350 --> 00:00:39,630
for our application.
13

14
00:00:39,630 --> 00:00:43,893
And here I will come, file, click file, and update settings,
14

15
00:00:44,730 --> 00:00:47,400
and here my project interpreter
15

16
00:00:47,400 --> 00:00:48,950
and here, what we need to do,
16

17
00:00:48,950 --> 00:00:52,390
We will install this ttkthemes package.
17

18
00:00:52,390 --> 00:00:54,239
To do that, what we need to do?
18

19
00:00:54,239 --> 00:00:56,940
We need to come here and click this plus symbol,
19

20
00:00:56,940 --> 00:01:00,870
it's here, and here we need to say ttkthemes.
20

21
00:01:00,870 --> 00:01:02,910
It's here. And after that, what you need to do?
21

22
00:01:02,910 --> 00:01:05,193
You need to say install package,
22

23
00:01:06,129 --> 00:01:07,520
and you will instal this package.
23

24
00:01:07,520 --> 00:01:10,390
I am not going to instal it because I already have it.
24

25
00:01:10,390 --> 00:01:11,750
And also there is a website
25

26
00:01:11,750 --> 00:01:13,890
for developer's website, is here.
26

27
00:01:13,890 --> 00:01:15,965
It is recommend to visit this website
27

28
00:01:15,965 --> 00:01:20,160
and learn more about this theme, this package.
28

29
00:01:20,160 --> 00:01:23,160
And of course you can see all the themes
29

30
00:01:23,160 --> 00:01:25,910
if you visit this website, also, by the way.
30

31
00:01:25,910 --> 00:01:29,300
And now let's go back to here
31

32
00:01:29,300 --> 00:01:32,830
and let's learn how we can implement this theme
32

33
00:01:32,830 --> 00:01:34,840
for our application.
33

34
00:01:34,840 --> 00:01:37,240
After installation the package,
34

35
00:01:37,240 --> 00:01:38,320
here, what we need to do.
35

36
00:01:38,320 --> 00:01:42,820
We will say from ttkthemes,
36

37
00:01:42,820 --> 00:01:43,653
import
37

38
00:01:45,860 --> 00:01:50,170
themed tk as tk.
38

39
00:01:50,170 --> 00:01:51,793
And after that, what we will do.
39

40
00:01:51,793 --> 00:01:53,433
We will remove this guy.
40

41
00:01:54,591 --> 00:01:57,790
And here we say root is equal to
41

42
00:01:57,790 --> 00:01:59,383
tk.ThemedTk.
42

43
00:02:02,949 --> 00:02:06,532
And after that we will say root.get themes,
43

44
00:02:08,640 --> 00:02:10,330
and for last,
44

45
00:02:10,330 --> 00:02:12,670
we will say root.set theme.
45

46
00:02:12,670 --> 00:02:16,743
Now we need to pass in here our theme name.
46

47
00:02:17,795 --> 00:02:20,493
And here we have all the theme names are here.
47

48
00:02:21,901 --> 00:02:23,887
And also there is one, radiance.
48

49
00:02:25,200 --> 00:02:28,760
And this one, for the first one I will use radiance,
49

50
00:02:28,760 --> 00:02:30,130
and after we will use the other ones
50

51
00:02:30,130 --> 00:02:33,293
so can we also check the other themes.
51

52
00:02:34,376 --> 00:02:37,590
And now, by the way, I want to tell you something.
52

53
00:02:37,590 --> 00:02:41,220
If you want to apply this theme for your GUI application,
53

54
00:02:41,220 --> 00:02:45,110
you need to create your widget by using ttk.
54

55
00:02:45,110 --> 00:02:48,963
If you use tk, let me remove this ttk.
55

56
00:02:52,530 --> 00:02:57,493
If you create your widgets by using tkinter
56

57
00:02:59,330 --> 00:03:01,093
you cannot apply this theme.
57

58
00:03:01,940 --> 00:03:04,173
And let me run our application now.
58

59
00:03:11,060 --> 00:03:11,893
Something wrong.
59

60
00:03:14,023 --> 00:03:15,690
Let me run it again.
60

61
00:03:19,643 --> 00:03:20,583
It's here.
61

62
00:03:21,540 --> 00:03:23,390
Our application is here, right?
62

63
00:03:23,390 --> 00:03:26,130
So now, as you see, it doesn't have a modern looking.
63

64
00:03:26,130 --> 00:03:28,190
Now we will apply this theme
64

65
00:03:28,190 --> 00:03:31,630
and we will have a more modern GUI application.
65

66
00:03:31,630 --> 00:03:33,010
So what we need to do,
66

67
00:03:33,010 --> 00:03:36,580
we need to change this widget.
67

68
00:03:36,580 --> 00:03:39,400
And you come here and say ttk label,
68

69
00:03:39,400 --> 00:03:43,690
and for all the widgets we need to use ttk module.
69

70
00:03:43,690 --> 00:03:45,093
And I will say ttk label.
70

71
00:03:46,000 --> 00:03:47,853
That one is also ttk.
71

72
00:03:49,730 --> 00:03:52,763
And for that one, ttk, I will say.
72

73
00:03:53,720 --> 00:03:55,713
For entry also, ttk.
73

74
00:03:59,480 --> 00:04:01,163
And for this one too.
74

75
00:04:03,795 --> 00:04:04,670
Name input is okay.
75

76
00:04:04,670 --> 00:04:05,673
Not that one.
76

77
00:04:06,980 --> 00:04:09,670
And radio buttons, for radio buttons
77

78
00:04:09,670 --> 00:04:12,083
I will say ttk.radiobutton.
78

79
00:04:15,130 --> 00:04:19,600
And for the last one is here, ttk.radiobutton.
79

80
00:04:19,600 --> 00:04:22,590
And here for the text we cannot use ttk by the way
80

81
00:04:22,590 --> 00:04:25,173
because text,
81

82
00:04:27,300 --> 00:04:30,893
as you see, ttk model doesn't have text widget,
82

83
00:04:30,893 --> 00:04:33,800
that's why I will paste this one.
83

84
00:04:33,800 --> 00:04:36,267
For the button also let's say ttk button.
84

85
00:04:39,225 --> 00:04:40,769
And ttk.
85

86
00:04:40,769 --> 00:04:42,053
Now it's okay.
86

87
00:04:42,053 --> 00:04:43,320
If we run our application,
87

88
00:04:43,320 --> 00:04:45,523
we will see how it is different.
88

89
00:04:49,990 --> 00:04:51,820
As you see now our theme is here
89

90
00:04:51,820 --> 00:04:54,230
and it's very different, you see.
90

91
00:04:54,230 --> 00:04:55,810
For this guy, we didn't apply it.
91

92
00:04:55,810 --> 00:04:56,773
Let me check it.
92

93
00:04:57,698 --> 00:04:59,740
Its name input, ttk entries.
93

94
00:04:59,740 --> 00:05:01,283
Surname input, ttk entries.
94

95
00:05:02,478 --> 00:05:04,850
And this is the for radiance theme.
95

96
00:05:04,850 --> 00:05:06,360
And if you want, of course,
96

97
00:05:06,360 --> 00:05:10,460
here you see it's like, we need to use here a pet
97

98
00:05:10,460 --> 00:05:14,470
because if you apply this theme for your application,
98

99
00:05:14,470 --> 00:05:15,920
you need to change something.
99

100
00:05:16,949 --> 00:05:20,210
And here also I want to show you other theme.
100

101
00:05:20,210 --> 00:05:21,757
For example, aquativo.
101

102
00:05:22,640 --> 00:05:25,470
Let's copy this one and apply it.
102

103
00:05:25,470 --> 00:05:27,033
And if I run it again,
103

104
00:05:28,600 --> 00:05:31,000
as you see now this aquativo.
104

105
00:05:31,000 --> 00:05:35,740
And also let's see how arc, for arc.
105

106
00:05:35,740 --> 00:05:38,333
Paste it here, and run it again.
106

107
00:05:42,420 --> 00:05:44,120
This is arc theme.
107

108
00:05:44,120 --> 00:05:45,240
It is also nice.
108

109
00:05:45,240 --> 00:05:47,310
You see it has a nice looking.
109

110
00:05:47,310 --> 00:05:49,223
And also let's use blue.
110

111
00:05:53,690 --> 00:05:54,523
Run.
111

112
00:05:58,240 --> 00:05:59,653
And this is blue one.
112

113
00:06:01,553 --> 00:06:03,903
And that one, also I want to use.
113

114
00:06:05,800 --> 00:06:07,280
By the way, there are more themes.
114

115
00:06:07,280 --> 00:06:09,620
You need to visit the developer's website.
115

116
00:06:09,620 --> 00:06:11,950
For more information, you should do that.
116

117
00:06:11,950 --> 00:06:13,753
As you see, this is elegance.
117

118
00:06:15,365 --> 00:06:18,773
And also let's see that one, clear looks.
118

119
00:06:21,932 --> 00:06:22,765
If I say run.
119

120
00:06:26,060 --> 00:06:29,210
As you see, I think this one is nice also.
120

121
00:06:29,210 --> 00:06:31,420
And also let's use this one,
121

122
00:06:31,420 --> 00:06:32,663
and this is last one.
122

123
00:06:34,020 --> 00:06:35,743
If I run my application again.
123

124
00:06:39,980 --> 00:06:43,090
And this is itft1.
124

125
00:06:43,090 --> 00:06:44,450
This is also nice.
125

126
00:06:44,450 --> 00:06:49,450
And this is how we can add more modern themes
126

127
00:06:50,040 --> 00:06:52,080
to our GUI application.
127

128
00:06:52,080 --> 00:06:52,940
For now, that's all.
128

129
00:06:52,940 --> 00:06:53,940
See you in the next.
