1
00:00:01,680 --> 00:00:06,630
I mean, this video, I want to continue on with the new window stuff, and there's a couple of odds

2
00:00:06,630 --> 00:00:07,800
and ends we need to talk about.

3
00:00:08,040 --> 00:00:12,960
I don't know if we'll get to images in this video or the next video, but first, I want to talk about

4
00:00:13,050 --> 00:00:21,580
sort of hiding the first window, showing the first window and destroying the second window manually.

5
00:00:21,600 --> 00:00:22,740
So let's do that first.

6
00:00:22,740 --> 00:00:28,140
Let's create a button in our second window and let's call this the destroy button.

7
00:00:29,800 --> 00:00:34,780
And it's going to be a button and we want to put this in our new window and we want the techs to equal

8
00:00:35,050 --> 00:00:36,700
quit, right.

9
00:00:37,060 --> 00:00:40,990
And we want the command to equal what so what command do we want?

10
00:00:40,990 --> 00:00:43,520
What we want to destroy.

11
00:00:44,080 --> 00:00:45,970
Now, this may or may not work.

12
00:00:45,970 --> 00:00:46,770
Let's try it.

13
00:00:46,780 --> 00:00:48,790
But first, we need to pack this onto the screen.

14
00:00:49,530 --> 00:00:50,290
Don Peck.

15
00:00:51,670 --> 00:00:55,330
OK, so we save this and run it, and I'm still in my new tappy file.

16
00:00:56,680 --> 00:00:58,420
So we can pull this up.

17
00:00:59,400 --> 00:01:06,710
And open our second window and here we go and quickly quit, boom, it it works, right?

18
00:01:12,110 --> 00:01:14,750
So that's a very easy way to close a window.

19
00:01:14,770 --> 00:01:20,830
Now, obviously you could just click the X to that works, but sometimes programmatically you may need

20
00:01:20,830 --> 00:01:26,690
to quit based on some sort of event that happens, clicking a button, doing something else.

21
00:01:26,710 --> 00:01:27,820
And so that's how you do that.

22
00:01:27,820 --> 00:01:33,610
So that's a quick and easy way to kill your your program.

23
00:01:33,640 --> 00:01:37,830
So now let's create a couple of more.

24
00:01:38,170 --> 00:01:39,490
Let's create a couple more buttons.

25
00:01:40,350 --> 00:01:41,580
Let's bring our text back up.

26
00:01:41,590 --> 00:01:43,470
So now let's create two more buttons.

27
00:01:43,480 --> 00:01:44,230
Let's go.

28
00:01:47,500 --> 00:01:48,820
Hide button.

29
00:01:50,710 --> 00:01:53,170
Analysts call, show, underscore button.

30
00:01:54,690 --> 00:02:03,620
So this is going to be a button and we want this in new and we want the text to equal hyd main window.

31
00:02:04,670 --> 00:02:09,350
And we want the command to equal something called Icona Fi.

32
00:02:11,260 --> 00:02:17,570
But it's route dot, I kind of fight because we want to do this to our route window, right?

33
00:02:18,220 --> 00:02:18,670
So.

34
00:02:20,390 --> 00:02:26,960
Let's copy this whole thing, and now we want to create another button that says show main window instead

35
00:02:26,960 --> 00:02:27,930
of icon of fire.

36
00:02:27,950 --> 00:02:30,400
This is going to be D icon Afie, right.

37
00:02:30,830 --> 00:02:38,240
So I icon of I means you're sort of like hiding it, but it's converting it to an icon which is small

38
00:02:38,240 --> 00:02:40,460
and hidden, I guess.

39
00:02:40,460 --> 00:02:40,760
Right.

40
00:02:40,940 --> 00:02:43,870
And to change that we die confi though.

41
00:02:43,910 --> 00:02:44,390
Whatever.

42
00:02:44,400 --> 00:02:47,390
Let's go ahead and hide button PIAC.

43
00:02:48,770 --> 00:02:51,360
And let's show button that pack.

44
00:02:51,850 --> 00:02:54,050
OK, so let's run this and see what this looks like.

45
00:02:57,950 --> 00:03:01,350
We have our first window boom, open the second window.

46
00:03:01,760 --> 00:03:04,860
Now we have the hide, hide, main window, boom, it disappears.

47
00:03:04,880 --> 00:03:11,450
Now if you can't see because it's on my other monitor, but that window still is in our sort of windows

48
00:03:12,410 --> 00:03:16,400
menubar at the very bottom of the screen that has the icons for all your running programs.

49
00:03:16,730 --> 00:03:17,480
It's still there.

50
00:03:17,480 --> 00:03:20,330
And if I click on it there, it will pop back up.

51
00:03:20,630 --> 00:03:23,540
So basically, this is the same as this.

52
00:03:23,540 --> 00:03:25,970
We're just minimizing it and you can sort of see it.

53
00:03:26,360 --> 00:03:27,980
It goes away like that.

54
00:03:28,370 --> 00:03:30,080
Or you could do it like this to show it again.

55
00:03:30,080 --> 00:03:31,040
We can click here, boom.

56
00:03:31,040 --> 00:03:36,650
It brings it back up, which is sort of the same thing as clicking on it on the sort of taskbar thing

57
00:03:36,650 --> 00:03:38,450
on the bottom of your your monitor.

58
00:03:39,080 --> 00:03:40,360
So that's kind of cool.

59
00:03:40,370 --> 00:03:46,760
You can also destroy the main menu menu, so.

60
00:03:48,010 --> 00:03:52,460
You know, instead of minimizing it, we can try destroying it.

61
00:03:53,080 --> 00:03:54,760
And there's a couple of ways we could do that.

62
00:03:55,450 --> 00:04:01,870
Pull up our code and I'm going to just copy these both and then.

63
00:04:03,540 --> 00:04:15,600
Paste them in again and here above the original ones, let's go minimise original window and I'm going

64
00:04:15,600 --> 00:04:23,220
to comment these out and here let's go with Draw Original.

65
00:04:25,100 --> 00:04:25,880
Window.

66
00:04:28,880 --> 00:04:34,730
And instead of root icona fi, we want to root with draw.

67
00:04:36,490 --> 00:04:36,820
Right.

68
00:04:37,540 --> 00:04:42,670
So this will sort of remove it from the screen, but it won't destroy it.

69
00:04:43,350 --> 00:04:44,200
So if we save this.

70
00:04:45,130 --> 00:04:51,760
And actually, before we do that, let's create one more button, because I'm a little anxious, let's

71
00:04:51,760 --> 00:04:54,130
call this Khil Original.

72
00:04:58,660 --> 00:05:00,190
And since the sequel to A Button.

73
00:05:01,530 --> 00:05:05,610
And it's going to be a new and text will be quit.

74
00:05:07,800 --> 00:05:08,550
Original.

75
00:05:10,130 --> 00:05:16,970
And the command will equal route destroy.

76
00:05:18,910 --> 00:05:21,070
And then let's pack this on the screen.

77
00:05:21,430 --> 00:05:22,900
OK, so let's say this and run it.

78
00:05:24,490 --> 00:05:28,670
So we have our original window, we click this boom, we get this other thing.

79
00:05:29,200 --> 00:05:32,560
Now we want to hide the main window, boom, it disappears.

80
00:05:32,710 --> 00:05:37,240
It does not show up as an icon in your sort of windows bar at the bottom of the screen, the little

81
00:05:37,240 --> 00:05:40,120
task bar thing, whatever that thing is called, it's completely gone.

82
00:05:40,120 --> 00:05:43,510
If we click here to show this again, boom, it pops back up.

83
00:05:44,380 --> 00:05:45,520
We can hide it.

84
00:05:48,160 --> 00:05:54,220
If we quit here, this one disappears, if we open it back up again and quit the original boom, everything

85
00:05:54,220 --> 00:05:56,440
up here, everything disappears, right?

86
00:05:56,920 --> 00:06:05,070
So those are how to minimize, maximize, hide and kill completely using second windows, a very cool.

87
00:06:05,080 --> 00:06:08,770
In the next video, we'll look at one more thing, using images on your second windows, because it

88
00:06:08,770 --> 00:06:12,280
is a little weird and it requires a little bit extra coating, but not too bad.

89
00:06:12,460 --> 00:06:14,710
And we'll look at that very quickly in the next video.
