You get a list of applications when you try the Open With option to open a certain type of file. If you try to associate a new application to open a certain type of file, you are shown a list of applications. The list of applications shown is the list of .desktop files in the /usr/share/applications directory.
Programs written by you or shared by a friend or compiled from source may not install their .desktop file in the /usr/share/applications directory. It takes a bit of work to get such a program added to the Open With list in Ubuntu. This post shows the details of how to achieve this. I use a method that is a bit easier.
First we need to create a .desktop file for your program. I find that the easiest way to do this is using the alacarte application. Installing and using alacarte is easy. Create a New Item using the name of your program. This creates a file of the name ~/.local/share/applications/alacarte-made.desktop.
Copy the above file somewhere and find the Exec section in the file. For example, this section might be:
Append a %F parameter to it:
This enables the .desktop file to be used to open a file using this program.
Finally copy this file to /usr/share/applications: