1
00:00:01,630 --> 00:00:07,270
OK, in this video, we want to look at how to create a second menu item for our program, so if we

2
00:00:07,270 --> 00:00:08,440
run our program real quick.

3
00:00:10,670 --> 00:00:16,880
Just to sort of refresh everything we see, we've got file now if we want more than one thing up here

4
00:00:17,120 --> 00:00:19,640
is that file, for instance, we want options.

5
00:00:19,970 --> 00:00:20,730
How do we do that?

6
00:00:20,750 --> 00:00:22,040
Well, it's pretty simple.

7
00:00:22,400 --> 00:00:25,670
We just create another submenu.

8
00:00:26,850 --> 00:00:33,060
Let's call this option, so again, we're going to do pretty much the same things here, so instead

9
00:00:33,060 --> 00:00:40,650
of file menu, let's call this one well, instead of option, let's call this edit because up here we've

10
00:00:40,650 --> 00:00:41,910
got file and edit.

11
00:00:41,910 --> 00:00:43,860
So let's stick with that sort of convention.

12
00:00:44,100 --> 00:00:46,770
So let's call this an edit menu.

13
00:00:47,040 --> 00:00:51,660
And again, you can Cully's anything you want and it's a menu and it goes in my menu.

14
00:00:52,650 --> 00:01:02,640
And then we can my underscore menu and underscore Kaskade to add this thing and let's call a label and

15
00:01:02,640 --> 00:01:03,930
what do we want to call this one edit?

16
00:01:04,850 --> 00:01:10,760
And the menu is going to equal edit menu.

17
00:01:11,950 --> 00:01:17,110
Because that's what we named it right here in this one, we call it file menu because we defined it

18
00:01:17,110 --> 00:01:22,930
as file menu, we call it file menu because it's a file menu, you know, or file there.

19
00:01:23,440 --> 00:01:24,340
This one is called EDIT.

20
00:01:24,340 --> 00:01:25,690
So we add it.

21
00:01:25,900 --> 00:01:30,250
So we put edit menu there, OK, and now we just add the things we want on there.

22
00:01:30,310 --> 00:01:35,320
Let's go edit underscore menu that add command.

23
00:01:36,600 --> 00:01:43,230
And we want to label and what do we want this to say, what is was the edit things say cut, copy and

24
00:01:43,230 --> 00:01:43,980
paste maybe.

25
00:01:44,580 --> 00:01:45,660
So let's go cut.

26
00:01:46,620 --> 00:01:47,980
And the command.

27
00:01:49,410 --> 00:01:52,440
Equals, which is call this fake command again.

28
00:01:53,130 --> 00:01:56,130
OK, so we can just copy this a couple of times.

29
00:01:57,520 --> 00:02:01,990
So let's go cut, copy and paste.

30
00:02:02,980 --> 00:02:07,000
Now, normally you're going to put different commands for each of these things because if you want to

31
00:02:07,000 --> 00:02:12,460
cut, you want to run the cut command, you know, if you want to copy, you want to run the copy command.

32
00:02:12,460 --> 00:02:13,990
And obviously those are going to be different.

33
00:02:14,350 --> 00:02:19,570
But just for the sake of showing you these things, we'll just run after command.

34
00:02:19,600 --> 00:02:20,660
Let's play with our command.

35
00:02:20,680 --> 00:02:26,590
Let's go my underscore label and say that's a label and it goes in root.

36
00:02:26,590 --> 00:02:31,690
And we want the text to say, you collect a menu item.

37
00:02:32,330 --> 00:02:32,980
I don't know.

38
00:02:33,400 --> 00:02:34,930
And then my label.

39
00:02:37,340 --> 00:02:38,590
Let's just pack this on there.

40
00:02:38,650 --> 00:02:40,120
OK, so let's save this and run it.

41
00:02:43,740 --> 00:02:49,110
And boom, we have another menu item up here, so this still works, we click Nueces, you click the

42
00:02:49,110 --> 00:02:49,860
menu item.

43
00:02:50,160 --> 00:02:52,650
If we click one of these, you click the menu item.

44
00:02:52,960 --> 00:02:53,390
Right?

45
00:02:54,290 --> 00:02:57,170
So very exciting, and that's really all there is to it.

46
00:02:57,200 --> 00:03:02,510
So any time you have more things to put up here, if you want more sort of menu items.

47
00:03:04,570 --> 00:03:09,850
For instance, if we look at Sublime, you know, we have file edit selection, fine view, whatever

48
00:03:09,850 --> 00:03:16,630
your program needs, you can create them just by sort of defining a new little submenu in this exact

49
00:03:16,630 --> 00:03:16,990
way.

50
00:03:17,180 --> 00:03:20,960
And I suggest you sort of name it what the main thing is.

51
00:03:21,190 --> 00:03:26,710
So if you were to create a view on I would call it a view menu, if you were to create a project one,

52
00:03:26,710 --> 00:03:28,630
I would call it a project menu.

53
00:03:29,110 --> 00:03:31,480
It's just sort of easier to keep track of it in your head.

54
00:03:31,600 --> 00:03:35,650
And when you read this code later on and go, OK, yeah, that's what that is.

55
00:03:35,890 --> 00:03:36,730
That makes sense.

56
00:03:36,970 --> 00:03:37,900
So that's menus.

57
00:03:37,900 --> 00:03:38,680
Pretty simple.

58
00:03:38,890 --> 00:03:44,260
In the next video, we'll look at frames and then we'll put frames and menus together to show you sort

59
00:03:44,260 --> 00:03:48,790
of how to open different screens by clicking on those different file menu things.

60
00:03:48,970 --> 00:03:51,190
And that'll be coming up in the next couple of videos.
