def filename(filename, reader=nil)
      @file = filename
      unless File.exists? filename
        alert "#{filename} does not exist"
        return
      end
      @filetype = File.extname filename
      if reader
        @list = reader.call(filename)
      else
        @list = File.open(filename,"r").read.split("\n")
      end
      if @filetype == ""
        if @list.first.index("ruby")
          @filetype = ".rb"
        end
      end
      init_vars
      @repaint_all = true
      @_populate_needed = true
    end
def filename(filename, reader=nil)
      @file = filename
      unless File.exists? filename
        alert "#{filename} does not exist"
        return
      end
      @filetype = File.extname filename
      if reader
        @list = reader.call(filename)
      else
        @list = File.open(filename,"r").read.split("\n")
      end
      if @filetype == ""
        if @list.first.index("ruby")
          @filetype = ".rb"
        end
      end
      init_vars
      @repaint_all = true
      @_populate_needed = true
    end
---- Section render related  end ----- }}}
 ---- Section data related start {{{
 supply a filename as source for textpad
 Reads up file into @list
 One can optionally send in a method which takes a filename and returns an array of data
 This is required if you are processing files which are binary such as zip/archives and wish
 to print the contents. (e.g. cygnus gem sends in :get_file_contents).
      filename("a.c", method(:get_file_contents))

 TODO: i think this should be sent to +text+ in case content_type has been set. FIXME