1. ------------------------------------------------------------------------------ 
  2. --                  GtkAda - Ada95 binding for Gtk+/Gnome                   -- 
  3. --                                                                          -- 
  4. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  5. --                     Copyright (C) 1998-2014, AdaCore                     -- 
  6. --                                                                          -- 
  7. -- This library is free software;  you can redistribute it and/or modify it -- 
  8. -- under terms of the  GNU General Public License  as published by the Free -- 
  9. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  10. -- version. This library is distributed in the hope that it will be useful, -- 
  11. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  12. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  13. --                                                                          -- 
  14. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  15. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  16. -- version 3.1, as published by the Free Software Foundation.               -- 
  17. --                                                                          -- 
  18. -- You should have received a copy of the GNU General Public License and    -- 
  19. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  20. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  21. -- <http://www.gnu.org/licenses/>.                                          -- 
  22. --                                                                          -- 
  23. ------------------------------------------------------------------------------ 
  24.  
  25. --  <description> 
  26. --  This package provides a high level support for creating file selection 
  27. --  dialogs by handling the signals internally. 
  28. --  </description> 
  29. --  <group>Selectors</group> 
  30.  
  31. with Glib; 
  32.  
  33. package Gtkada.File_Selection is 
  34.  
  35.    function File_Selection_Dialog 
  36.      (Title       : Glib.UTF8_String := "Select File"; 
  37.       Default_Dir : String := ""; 
  38.       Dir_Only    : Boolean := False; 
  39.       Must_Exist  : Boolean := False) return String; 
  40.    --  Open a file selection dialog and make it modal. 
  41.    --  Return when either the Cancel button is clicked or when a file is 
  42.    --  selected. 
  43.    --  Default_Dir is the directory to display in dialog initially. Note that 
  44.    --  it must end with a directory separator ('/' or '\', depending on your 
  45.    --  system). You can use GNAT.Os_Lib.Directory_Separator to get the correct 
  46.    --  value for your system. 
  47.    --  If Must_Exist is True, then the file (or directory if Dir_Only is True) 
  48.    --  must exist. 
  49.    --  If Dir_Only is True, then the dialog is modified so that the user can 
  50.    --  only choose a directory name, but not a file name. 
  51.    --  The value returned is the name of the file selected, or "" if none. 
  52.  
  53. end Gtkada.File_Selection;