1
00:00:01,660 --> 00:00:07,010
OK, this video I want to talk about status bars and my status bars, like take a look at sublime text

2
00:00:07,010 --> 00:00:08,950
down here at the bottom, we've got a little bar.

3
00:00:09,280 --> 00:00:13,030
There's a status it might change based on what you do, et cetera.

4
00:00:13,040 --> 00:00:14,050
How do we do that with Kenta?

5
00:00:14,080 --> 00:00:20,140
Well, actually, there is no status or widget with Kintner, but we can kind of hack around with a

6
00:00:20,140 --> 00:00:22,030
regular label to make one.

7
00:00:22,040 --> 00:00:24,160
So that's what we're going to do in this video.

8
00:00:24,170 --> 00:00:24,520
So.

9
00:00:24,740 --> 00:00:28,780
All right, I've got a new file called Status Stoppie, and this is the same stuff we've been working

10
00:00:28,780 --> 00:00:29,020
with.

11
00:00:29,020 --> 00:00:32,740
It's just a regular menu stuff and nothing else.

12
00:00:32,890 --> 00:00:40,350
So let's come down here to the bottom and let's just create a label real quick and I don't know, let's

13
00:00:40,360 --> 00:00:42,250
call it minor score status.

14
00:00:42,910 --> 00:00:44,800
And we want to set that equal to a label.

15
00:00:45,760 --> 00:00:50,980
And we want this in root and we want the text to say, I don't know, waiting.

16
00:00:52,890 --> 00:00:55,800
And let's give this a border of two.

17
00:00:57,630 --> 00:01:02,190
And let's make this relief equals sunken.

18
00:01:03,440 --> 00:01:09,260
Because we want it to look like it's kind of sunken in, it's like a status bar right now, we want

19
00:01:09,260 --> 00:01:12,880
this to kind of span the whole width of our program.

20
00:01:13,220 --> 00:01:21,140
So let's give this a width of, let's say, 50, and we'll take a look and see what this does in just

21
00:01:21,140 --> 00:01:21,590
a second.

22
00:01:21,620 --> 00:01:30,820
So now let's just go my underscore status dot grid, and we want it to be in row to column zero.

23
00:01:31,010 --> 00:01:33,170
I don't know what row wrong, I think.

24
00:01:34,430 --> 00:01:40,690
It was started with Ruwan, actually, this should be Rosero, but either way, it doesn't really matter.

25
00:01:43,440 --> 00:01:45,840
If that's Rosero, then this will be a real one.

26
00:01:46,090 --> 00:01:47,190
OK, so if we save this.

27
00:01:48,350 --> 00:01:52,490
And let's just run this real quick, so run python stats, not by.

28
00:01:53,880 --> 00:01:58,920
You see, OK, we've got this bar and it's at the top, it's not at the bottom, which is a problem

29
00:01:59,100 --> 00:02:01,400
and it doesn't quite go all the way across.

30
00:02:01,410 --> 00:02:03,240
So we need to fiddle with our width.

31
00:02:03,540 --> 00:02:10,980
So I'm going to just come back over here and let's give this a fifty five and save this and run it.

32
00:02:11,100 --> 00:02:14,760
Now, this is not the best way to do it, but for our simple program, this will work.

33
00:02:14,760 --> 00:02:16,730
OK, so we still got a little bit of space left.

34
00:02:17,160 --> 00:02:18,920
Let's try, I don't know.

35
00:02:18,930 --> 00:02:19,800
Fifty six.

36
00:02:20,400 --> 00:02:24,360
And as your program gets more complicated there's better ways to do this.

37
00:02:24,360 --> 00:02:27,780
But since this is a simple program, OK, that's basically good enough.

38
00:02:27,960 --> 00:02:29,700
OK, now this waiting thing is in the middle.

39
00:02:29,700 --> 00:02:31,470
We want this kind of over to the side.

40
00:02:31,470 --> 00:02:32,520
So how do we change that?

41
00:02:33,210 --> 00:02:34,590
Well, we can anchor this.

42
00:02:34,590 --> 00:02:40,500
I don't know if we looked at anchor or not when we looked at labels, but we can just call anchor and

43
00:02:40,500 --> 00:02:41,630
set that equal to east.

44
00:02:41,640 --> 00:02:44,700
So north, south, east, west, east would be right.

45
00:02:44,730 --> 00:02:48,900
So let's go ahead and say this and run it and see.

46
00:02:49,830 --> 00:02:56,040
OK, so now we've got waiting over there and that seems to be working OK, so now it's at the top,

47
00:02:56,040 --> 00:02:57,380
though, instead of at the bottom.

48
00:02:57,600 --> 00:03:03,570
And the reason why that is, is because in our program here at the top, we just designated that this

49
00:03:03,570 --> 00:03:05,130
is going to be four hundred by four hundred.

50
00:03:05,130 --> 00:03:06,890
And this is sort of an arbitrary thing.

51
00:03:07,140 --> 00:03:09,420
This will change based on what your actual program is.

52
00:03:09,500 --> 00:03:12,000
I'm just going to comment that out for now.

53
00:03:12,120 --> 00:03:13,590
And let's take a look at this.

54
00:03:15,150 --> 00:03:20,310
And see, now we've got this now it's definitely at the bottom, but if we click one of these things,

55
00:03:20,790 --> 00:03:26,100
see now it is at the bottom when we actually put stuff on the screen, this will be at the bottom so

56
00:03:26,610 --> 00:03:29,490
we can change this and that works.

57
00:03:30,060 --> 00:03:31,920
OK, so we've got this thing.

58
00:03:31,920 --> 00:03:33,630
It's kind of looks like a bar thing.

59
00:03:33,630 --> 00:03:34,500
It's kind of cool.

60
00:03:34,500 --> 00:03:39,030
But now this doesn't change based on, you know, anything.

61
00:03:39,030 --> 00:03:40,710
It just keeps saying waiting.

62
00:03:41,010 --> 00:03:42,270
So how do we change this?

63
00:03:42,300 --> 00:03:44,360
Well, there's a bunch of different ways that you can change it.

64
00:03:45,430 --> 00:03:51,340
But something we haven't talked about yet is string variables, we can create a string variable and

65
00:03:51,340 --> 00:03:57,150
let's just call it current under score status and let's set that equal to a string var.

66
00:03:57,550 --> 00:03:59,010
Now this becomes a function.

67
00:03:59,200 --> 00:04:04,050
So now we can set and get this string variable.

68
00:04:04,060 --> 00:04:08,980
So let's call this current underscore status dot set.

69
00:04:09,010 --> 00:04:10,150
We want to set it aside.

70
00:04:10,150 --> 00:04:15,800
What do we want to set this as a misspelled waiting right there.

71
00:04:15,820 --> 00:04:16,670
A misspelled wedding.

72
00:04:16,720 --> 00:04:23,500
OK, so now we've set this to waiting and instead of putting text here, we can put this variable.

73
00:04:24,530 --> 00:04:32,420
So if we copy this and paste that in, so our text is current status, but we now need to change this

74
00:04:32,420 --> 00:04:35,610
from text to text variable.

75
00:04:35,930 --> 00:04:38,630
Now, if you're using a regular variable, you don't have to change it.

76
00:04:38,640 --> 00:04:41,500
You could just leave it as text and then put your variable in here.

77
00:04:41,750 --> 00:04:47,990
But since this is we've converted it to a string variable, a string var, which is a specific Kintner

78
00:04:47,990 --> 00:04:48,470
thing.

79
00:04:48,650 --> 00:04:49,740
This is not a python thing.

80
00:04:49,760 --> 00:04:50,840
This is a Kintyre thing.

81
00:04:51,120 --> 00:04:54,500
So since this is a counter thing, we have to change this to text variable.

82
00:04:54,770 --> 00:04:55,070
All right.

83
00:04:55,070 --> 00:05:00,140
So let's save this and let's run this guy and make sure that worked.

84
00:05:01,000 --> 00:05:05,900
And sure enough, it says waiting there, but again, if we click this, nothing actually happens.

85
00:05:06,160 --> 00:05:08,170
So what we want to do now is.

86
00:05:09,650 --> 00:05:16,870
See how we set this just like this, if we copy this and come up to each of our new functions, right.

87
00:05:17,150 --> 00:05:23,900
And then say here we want to put a message for cut cut status.

88
00:05:24,000 --> 00:05:24,590
Right.

89
00:05:24,980 --> 00:05:26,330
And here for.

90
00:05:26,330 --> 00:05:27,200
Let's see.

91
00:05:28,320 --> 00:05:29,640
The edit frame.

92
00:05:31,780 --> 00:05:33,280
We're going to go right here.

93
00:05:34,220 --> 00:05:41,680
We want to call this the file status, whatever, that we save this and come back and run this guy again.

94
00:05:44,440 --> 00:05:51,740
Waiting if we click cut now it says cut status if we click file now it says file status and this will

95
00:05:51,740 --> 00:05:52,880
update based on whatever.

96
00:05:52,910 --> 00:05:55,220
Now, this is a silly example, right?

97
00:05:55,220 --> 00:05:56,720
File status status.

98
00:05:56,720 --> 00:05:57,620
That doesn't mean anything.

99
00:05:57,800 --> 00:06:05,090
But if you're creating some more sophisticated program and you have a countdown or you have, you know,

100
00:06:05,300 --> 00:06:10,670
for instance, if you created an image viewer and you're showing image one of four, image two or four,

101
00:06:10,670 --> 00:06:13,490
image three or four, you would want that to update accordingly.

102
00:06:13,670 --> 00:06:14,840
Or you could do that now.

103
00:06:14,840 --> 00:06:20,480
And the exact same way we've just learned just by calling the variable set and then passing in whatever

104
00:06:20,480 --> 00:06:21,020
you want.

105
00:06:21,650 --> 00:06:22,850
So that's pretty cool.

106
00:06:22,880 --> 00:06:24,960
So that's sort of a hacky way to do that.

107
00:06:25,160 --> 00:06:28,880
Spa's it's not the cleanest thing in the world, but sometimes with cancer, you just have to kind of

108
00:06:28,880 --> 00:06:30,800
hack things around and make them do what they want.

109
00:06:31,010 --> 00:06:36,350
And obviously, you can make this look any any way you want just by using different border with by using

110
00:06:36,350 --> 00:06:39,740
different colors, by using different reliefs we use sunk in.

111
00:06:39,740 --> 00:06:44,360
But remember, there are several different reliefs that we looked out at the label video and go back

112
00:06:44,360 --> 00:06:46,600
and watch that if you need to brush up on that.

113
00:06:47,360 --> 00:06:48,070
And it's pretty cool.

114
00:06:48,080 --> 00:06:49,450
So that's all for status bars.

115
00:06:49,460 --> 00:06:51,560
In the next video, we'll look at radio buttons.
