/Doc/file_dialogs.html

https://bitbucket.org/alsh/pygui-mirror · HTML · 105 lines · 89 code · 16 blank · 0 comment · 0 complexity · e41d5624f2f872fb3adaee9ac5b77ed1 MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  2. <html><head><title>PyGUI - File Dialog Functions</title>
  3. <meta name="GENERATOR" content="Mozilla/3.01Gold (X11; I; SunOS 5.6 sun4u) [Netscape]"></head>
  4. <body>
  5. <h1>File dialog functions</h1>
  6. <p>These functions present dialog boxes for requesting new and existing files and directories according
  7. to platform conventions.<br>
  8. </p>
  9. <h2>Parameters</h2>
  10. <p>The following parameters are used by these functions:<br>
  11. </p>
  12. <dl style="margin-left: 40px;">
  13. <dt style="font-family: monospace;">prompt</dt>
  14. <dd>A prompt string to be displayed. It is up to the platform exactly
  15. where and how the prompt is shown, and it may not be shown at all in
  16. some cases. If omitted, a suitable default is used depending on the
  17. type of request.<br>
  18. <br>
  19. </dd>
  20. <dt style="font-family: monospace;">default_dir</dt>
  21. <dd>A <a href="FileRef.html">FileRef</a> or <a href="DirRef.html">DirRef</a>
  22. specifying the initial directory to be browsed. If omitted, a
  23. platform-dependent default is used (usually the last directory visited
  24. in the application by a file dialog).<br>
  25. <br>
  26. </dd>
  27. <dt style="font-family: monospace;">default_name</dt>
  28. <dd>For functions that request a new object name, the initial value
  29. entered into the name area of the dialog. If omitted, the name area is
  30. initially empty.<br>
  31. <br>
  32. </dd>
  33. <dt><span style="font-family: monospace;">file_type, file_types</span></dt>
  34. <dd>A <a href="FileRef.html">FileRef</a> or list of <a href="FileRef.html">FileRef</a>s specifying acceptable file types.</dd>
  35. </dl>
  36. <h2>Functions</h2>
  37. <dl style="margin-left: 40px;">
  38. <dt><tt><a name="request_old_file"></a>request_old_file(</tt><tt>prompt</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>default_dir</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>file_types</tt> <tt>=</tt> <tt>None<span style="font-family: monospace;">)</span><br>
  39. <br>
  40. </tt></dt>
  41. <dd>Prompts the user to select an existing file. If any <span style="font-style: italic;">file_types</span> are supplied, the user is only allowed to select a file matching one of the specified types.</dd><dd><br>
  42. </dd>
  43. <dd>Returns a <a href="FileRef.html">FileRef</a>, or <tt>None</tt> if the user cancelled.</dd>
  44. </dl>
  45. <dl style="margin-left: 40px;">
  46. </dl>
  47. <dl style="margin-left: 40px;">
  48. <dt><tt>request_old_files(</tt><tt>prompt</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>default_dir</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>file_types</tt> <tt>=</tt> <tt>None</tt><tt>)<br>
  49. <br>
  50. </tt></dt><dd>Prompts the user to select a set of existing files. If any <span style="font-style: italic;">file_types</span> are supplied, the user is only allowed to select files matching one of the specified types.</dd><dd><br>
  51. </dd><dd>Returns a list of <a href="FileRef.html">FileRef</a>s, or <tt>None</tt> if the user cancelled.</dd>
  52. </dl>
  53. <dl style="margin-left: 40px;">
  54. <dt><a name="request_new_file"></a><tt>request_new_file(</tt><tt>prompt</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>default_dir</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>default_name</tt> <tt>=</tt> <tt style="font-family: monospace;">None,</tt> <tt>file_type</tt> <tt>=</tt> <tt>None<span style="font-family: monospace;">)</span><br>
  55. <br>
  56. </tt></dt>
  57. <dd>Prompts the user to supply a name and location for a new file. If <span style="font-style: italic;">file_type</span>
  58. is specified, it should represent the type if file which is to be
  59. created; some platforms use this to restrict the list of existing files
  60. displayed, and to determine the suffix of the returned filename.<br>
  61. </dd><dd><br>
  62. </dd>
  63. <dd>Returns a <a href="FileRef.html">FileRef</a>, or <tt>None</tt> if the user cancelled.</dd>
  64. <dl>
  65. </dl>
  66. </dl>
  67. <dl style="margin-left: 40px;">
  68. <dt><tt>request_old_directory(</tt><tt>prompt</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>default_dir</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>)</tt></dt><dd><br>
  69. Prompts the user to select an existing directory.</dd><dd><br>
  70. </dd><dd>Returns a <a href="FileRef.html">FileRef</a>, or <tt>None</tt> if the user cancelled.</dd>
  71. </dl>
  72. <dl style="margin-left: 40px;">
  73. <dt><dt><tt>request_old_directories(</tt><tt>prompt</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>default_dir</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>)</tt></dt>
  74. </dt><dd><br>
  75. Prompts the user to select a set of existing directories.</dd>
  76. <dd><br>
  77. </dd>
  78. <dd>Returns a list of <a href="FileRef.html">FileRef</a>s, or <tt>None</tt> if the user cancelled.</dd>
  79. </dl>
  80. <dl style="margin-left: 40px;">
  81. <dt><tt>request_new_directory(</tt><tt>prompt</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>default_dir</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt>,</tt> <tt>default_name</tt> <tt>=</tt> <span style="font-family: monospace;">None</span><tt><span style="font-family: monospace;">)</span><br>
  82. <br>
  83. </tt></dt>
  84. <dd>Prompts the user to supply a name and location for a new directory.<br>
  85. </dd><dd><br>
  86. </dd><dd>Returns a <a href="FileRef.html">FileRef</a>, or <tt>None</tt> if the user cancelled.</dd>
  87. </dl>
  88. ---<br>
  89. </body></html>