Creating GUI Application using Gtk & Vala

Quick Read : Creating a GUI application using Gtk & Vala.

What is GTK ?

GTK+, or the GIMP Toolkit, is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off tools to complete application suites.

[myinlink sub=”How to Install Vala Compiler in Ubuntu” link=”http://webcheerz.com/install-vala-compiler-ubuntu/”]Click Here to Read[/myinlink]

In the Previous article, we saw about installing vala in our Ubuntu System. So now we have to do something quite useful for daily usage application. We use our laptop/PC for a long time in a day. Our system probably uses caches to speed up the process & operation time. PC/Laptop also saves the Recently visited folders as Recent Documents.

Those Recent Document folder Contains recently visited folders. Those folders will use very large number of space in your system root folder. So we have to clear those folders in the Correct interval of time to get high working experience.

gui application using Gtk vala

 

Now we’re going to make a Simple GUI Application using Gtk & Vala to clear Recent Documents in our PC.

To Open Terminal :

In Ubuntu:

Press [keybt]Ctrl[/keybt] + [keybt]Alt[/keybt] + [keybt]T[/keybt]

In Elementary OS:

Press [keybt]WinKey[/keybt] + [keybt]T[/keybt]

To Create Application:
Paste this code in Terminal & Hit Enter

It’ll Open a Gedit with a file name guiapp.vala

gui application using Gtk vala

Now paste the Below Code in that gedit file.

Click File -> Save or Press [keybt]Ctrl[/keybt] + [keybt]S[/keybt] to Save. Then Close Gedit

[gads]
gui application using Gtk vala
Screenshot Captured using Shutter
[myinlink sub=”How to Install Shutter in Ubuntu/Elementary OS” link=”http://webcheerz.com/install-shutter-ubuntu/”]Click Here to Read[/myinlink]
To Compile :

Open terminal and paste the below code then press enter

gui application using Gtk vala
To Run the Program :

Run this command line in the terminal to run the program.

gui application using Gtk vala

That’s all you have successfully Created your first GUI Application.
gui application using Gtk vala

Was this article helpful?

Thanks

Thanks for your Feeback. It will helps us to improve our Article quality