# File lib/foxtails/FTFileBrowser.rb, line 23
    def initialize parent, target, state,
                    opts = LAYOUT_FILL_X|FRAME_RAISED,
                    filelist_opts = ICONLIST_MINI_ICONS|ICONLIST_AUTOSIZE
      
      FoxTails.get_file_icons
      FoxTails.get_browse_icons
      
      @outer_frame = FXHorizontalFrame.new(parent, opts)

      inner_frame = FXHorizontalFrame.new(@outer_frame,
        FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
      
      super(inner_frame, target, state,
            LAYOUT_FILL_X|LAYOUT_FILL_Y|filelist_opts)
      
      connect(SEL_DOUBLECLICKED, method(:onCmdFileList))
      connect(SEL_RIGHTBUTTONRELEASE, method(:onPopupMenu))
      
      btn_frame = FXVerticalFrame.new(@outer_frame)
      
      ## need a drive box button for windows
      
      FTEnabledButton.new(btn_frame,
        "\tUp one level\tGo up to higher directory.",
        UPLEVEL_ICON, self, :can_go_up, BUTTON_TOOLBAR|FRAME_RAISED).
        connect(SEL_COMMAND) {on_cmd_up_dir}

      FXButton.new(btn_frame, "\tGo home\tGo to home directory.",
        HOME_ICON, self, 0, BUTTON_TOOLBAR|FRAME_RAISED).
        connect(SEL_COMMAND) {on_cmd_home_dir}

      FTEnabledButton.new(btn_frame,
        "\tCreate new directory\tCreate new directory.",
        NEW_DIR_ICON, self, :can_write, BUTTON_TOOLBAR|FRAME_RAISED).
        connect(SEL_COMMAND) {on_cmd_new_dir}

      FTPopupButton.new(btn_frame, "\tBookmarks\tBookmarks.",
        MARK_ICON, self, 0, BUTTON_TOOLBAR|FRAME_RAISED) {make_bookmark_popup}
      
      self.shown_state      = true
      self.show_icons_state = :mini
      self.arrange_state    = :by_rows
      
      when_shown_state(true)  { show; recalc } ## how to recalc?
      when_shown_state(false) { hide; recalc }
      
      when_show_icons_state(:big)      { show_big_icons     }
      when_show_icons_state(:mini)     { show_mini_icons    }
      when_show_icons_state(:details)  { show_details      }

      when_arrange_state(:by_rows)     { arrange_by_rows    }
      when_arrange_state(:by_columns)  { arrange_by_columns }
      
      when_show_hidden_state BOOLEAN do |bool|
        self.hiddenFilesShown = bool
      end
    end