add function to open files from button or menu item
optimize some codes
from a file dialog select a file and display its contents