GtkFileSelection            package:RGtk2            R Documentation

_G_t_k_F_i_l_e_S_e_l_e_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Prompt the user for a file or directory name

_M_e_t_h_o_d_s _a_n_d _F_u_n_c_t_i_o_n_s:

     'gtkFileSelectionNew(title = NULL, show = TRUE)'
      'gtkFileSelectionSetFilename(object, filename)'
      'gtkFileSelectionGetFilename(object)'
      'gtkFileSelectionComplete(object, pattern)'
      'gtkFileSelectionShowFileopButtons(object)'
      'gtkFileSelectionHideFileopButtons(object)'
      'gtkFileSelectionGetSelections(object)'
      'gtkFileSelectionSetSelectMultiple(object, select.multiple)'
      'gtkFileSelectionGetSelectMultiple(object)'
      'gtkFileSelection(title = NULL, show = TRUE)'

_H_i_e_r_a_r_c_h_y:

     GObject
        +----GtkObject
              +----GtkWidget
                    +----GtkContainer
                          +----GtkBin
                                +----GtkWindow
                                      +----GtkDialog
                                            +----GtkFileSelection 

_I_n_t_e_r_f_a_c_e_s:

     GtkFileSelection implements AtkImplementorIface.

_D_e_t_a_i_l_e_d _D_e_s_c_r_i_p_t_i_o_n:

     'GtkFileSelection' should be used to retrieve file or directory
     names from  the user. It will create a new dialog window
     containing a directory list,  and a file list corresponding to the
     current working directory. The filesystem  can be navigated using
     the directory list or the drop-down history menu.  Alternatively,
     the TAB key can be used to navigate using filename  completion -
     common in text based editors such as emacs and jed.

     File selection dialogs are created with a call to
     'gtkFileSelectionNew'.

     The default filename can be set using
     'gtkFileSelectionSetFilename' and the selected filename retrieved
     using 'gtkFileSelectionGetFilename'.

     Use 'gtkFileSelectionComplete' to display files and directories
     that match a given pattern. This can be used for example, to show
     only *.txt files, or only files beginning with gtk*.

     Simple file operations; create directory, delete file, and rename
     file, are available from buttons at the top of the dialog. These
     can be hidden using 'gtkFileSelectionHideFileopButtons' and shown
     again using 'gtkFileSelectionShowFileopButtons'.


     # Getting a filename from a user
     # Note how much easier GtkFileChooser is to use

     store_filename <- function(widget, file_selector) {
        selected_filename <- file_selector$getFilename();
        print(paste("Selected filename:", selected_filename))
     }

     create_file_selection <- function() {

       # Create the selector

        file_selector <- gtkFileSelection("Please select a file for
     editing.", show = F)

        gSignalConnect(file_selector[["ok_button"]], "clicked",
     store_filename,
                          file_selector)

        # Ensure that the dialog box is destroyed when the user clicks
     a button.

        gSignalConnect(file_selector[["ok_button"]], "clicked",
     gtkWidgetDestroy, 
                                  file_selector, user.data.first = T)

        gSignalConnect(file_selector[["cancel_button"]], "clicked",
     gtkWidgetDestroy,
                                  file_selector, user.data.first = T) 

        # Display that dialog

        file_selector$show()
     }


_S_t_r_u_c_t_u_r_e_s:

     '_G_t_k_F_i_l_e_S_e_l_e_c_t_i_o_n' The 'GtkFileSelection' struct contains the
          following 'GtkWidget' fields:

            *fileop_dialog;                                     the dialog box used to display the   'GtkFileSelection'  . It can be customized by adding/removing widgets from it using the standard   'GtkDialog'   functions.
            *ok_button, *cancel_button;                         the two main buttons that signals should be connected to in order to perform an action when the user hits either OK or Cancel.
            *history_pulldown;                                  the   'GtkOptionMenu'   used to create the drop-down directory history.
            *fileop_c_dir, *fileop_del_file, *fileop_ren_file;  the buttons that appear at the top of the file selection dialog. These "operation buttons" can be hidden and redisplayed with   'gtkFileSelectionHideFileopButtons'   and    'gtkFileSelectionShowFileopButtons'   respectively.

_C_o_n_v_e_n_i_e_n_t _C_o_n_s_t_r_u_c_t_i_o_n:

     'gtkFileSelection' is the equivalent of 'gtkFileSelectionNew'.

_P_r_o_p_e_r_t_i_e_s:

     '_f_i_l_e_n_a_m_e' [_c_h_a_r_a_c_t_e_r : _R_e_a_d / _W_r_i_t_e] The currently selected
          filename.  Default value: NULL


     '_s_e_l_e_c_t-_m_u_l_t_i_p_l_e' [_l_o_g_i_c_a_l : _R_e_a_d / _W_r_i_t_e] Whether to allow
          multiple files to be selected.  Default value: FALSE


     '_s_h_o_w-_f_i_l_e_o_p_s' [_l_o_g_i_c_a_l : _R_e_a_d / _W_r_i_t_e] Whether buttons for
          creating/manipulating files should be displayed.  Default
          value: FALSE


_A_u_t_h_o_r(_s):

     Derived by RGtkGen from GTK+ documentation

_R_e_f_e_r_e_n_c_e_s:

     <URL:
     http://developer.gnome.org/doc/API/2.0/gtk/GtkFileSelection.html>

