Hi.
Welcome back.
Throughout today's and tomorrow's bonus example videos, you will learn how to build this app.
This is a file compressor.
So first I'll demonstrate you what this app does.
And then we go ahead and build it in this video.
So today in this video, we'll build.
The graphical user interface.
And then tomorrow we will implement all the functionalities of the app.
So this is a complete version of the app.
And the way it works is this.
So here we have this two buttons.
The first button is used to select the files that the user needs to compress.
So, for example, if I press on shoes and I go to a folder, I select one file or multiple files pressing
the button by holding the shift button pressed.
For example, I selected three text files I press on open and the paths of those files are reflected
in here automatically.
So these are absolute file paths.
And then this other button allows me to select the directory where the zip file is going to be created.
So that can be any directory.
So I'm just choosing this one.
Choose the path of the directory is also reflected in here.
And then if I press compress.
I'm going to get this message that the compression was successful and then I go to the destination folder,
my files, and that's the zip file that was created.
So if I extract it, I'm going to see a folder with all those three files inside.
So that's how this app works.
Let's go ahead and build it.
Now I'm going to create a new bonus.
16 that p y file in the bonus folder.
And then import pure, simple, gooey.
So you saw from the output that in the first row we had an SD dot text.
Object.
So it was a label and we create labels using that text type to create text instances, label instances,
whatever you call them.
So that was select.
For us to compress.
And then we had an input widget as g that input.
Then we had that choose button on the side.
So, so far we have select files to compress that label this input box and this choose button.
Now the button.
Let's call this choose button one, because we have two buttons, one here and one here.
So this will be number one.
And the button is not a generic button.
So you don't want to use a digital button, you want to use files.
Browse.
And then write the label of the button.
In our case, it is choose.
So this is a special button because it's already programmed to select files.
And the other button we built today for our to do app.
The button can take different roles depending on what we write.
So afterwards we're going to program that button to do specific things.
But this button is a special case of a button.
It does one thing only, and that is to allow the user to select files on their file system.
So as you saw in the demonstration, this is what this does.
So it selects it allows the user to select files.
Right.
Let's go ahead and create some other widgets.
The second line.
I'm just going to copy these because the second line is mostly the same and change label one to label
two and then here select.
Destination folder and this will be input to it's still an input text box.
So that one in here, this and then the choose button this time is not file browse is another specialized
button.
It's called Folder Browse.
So this will they choose button to.
And we're going to keep the same label for that as well.
And that's what we have for now.
So let's go ahead and create the window object now, which is equal to that window.
We want to give a name to the window such as file.
Compressor.
And then we want to give the layout arguments, which is going to be a list of lists.
The first list is the first row.
So it's that first row which contains labeled one input one and choose button one.
So those three items label one, comma input one.
On.
Choose button one.
That's it.
So that's the first list.
A comma after the list.
It's a good idea to split this into a different line because this line is getting too long.
And also in here after the comma.
So we write one list after the comma was completed again.
And this here will be the second list.
So that's the first list, comma.
Second list.
And this is the main altar list.
These are two brackets, right?
The second list is labeled two comma input, two comma, choose button two.
That's it.
Then we want to read the window and then we want to close the window.
So now it's time to run this program.
And yeah, that's the output.
The theme is different.
And so later we will work on the theme and the size.
For now, let's ignore those aspects and focus on building the widgets.
So we have a label widget, an input widget and a button widgets.
If I choose some files now, for example, I press the shift key and hold it.
Choose multiple files, press and open.
Those files are automatically reflected in this input box here.
The same goes for destination folder.
I can go to some other folder, choose a destination folder, press enter.
And that's the path of the destination folder as well.
And before we close the video, let's also add that compressed button.
So that's going to be.
A normal button using.
The button type compress.
So I can add that as a separate list here.
Compress button.
So we have the first row comma, the second row comma, and the third row I run this, and that's the
final layout of our program.
So tomorrow we're going to make this program alive so that when the user presses that button, the selected
files are going to be extracted in the selected directory here.
So see you tomorrow.
Thanks.