Support files and standard input

In the gtk example, add the ability to specify an input file, or to get the
data from standard input.