|
1 | 1 | Documentation |
2 | 2 | ============= |
3 | 3 |
|
4 | | -Functions |
5 | | ---------- |
| 4 | +askopendirname |
| 5 | +-------------- |
| 6 | +.. autofunction:: tkfilebrowser.askopendirname |
6 | 7 |
|
7 | | -- *askopendirname* |
| 8 | +askopendirnames |
| 9 | +--------------- |
| 10 | +.. autofunction:: tkfilebrowser.askopendirnames |
8 | 11 |
|
9 | | - Allow the user to choose a single directory. The absolute path of the |
10 | | - chosen directory is returned. If the user cancels, an empty string is |
11 | | - returned. |
12 | | - |
13 | | - Syntax: |
14 | | - |
15 | | - :: |
16 | | - |
17 | | - askopendirname(parent=None, title=_("Open"), **kwargs) |
18 | | - |
19 | | -- *askopendirnames* |
20 | | - |
21 | | - Allow the user to choose multiple directories. A tuple containing the absolute |
22 | | - path of the chosen directories is returned. If the user cancels, |
23 | | - an empty tuple is returned. |
24 | | - |
25 | | - Syntax: |
26 | | - |
27 | | - :: |
28 | | - |
29 | | - askopendirnames(parent=None, title=_("Open"), **kwargs) |
30 | | - |
31 | | -- *skopenfilename* |
| 12 | +askopenfilename |
| 13 | +--------------- |
| 14 | +.. autofunction:: tkfilebrowser.askopenfilename |
32 | 15 |
|
33 | | - Allow the user to choose a single file. The absolute path of the |
34 | | - chosen file is returned. If the user cancels, an empty string is |
35 | | - returned. |
36 | | - |
37 | | - Syntax: |
38 | | - |
39 | | - :: |
40 | | - |
41 | | - askopenfilename(parent=None, title=_("Open"), **kwargs) |
42 | | - |
43 | | -- *askopenfilenames* |
| 16 | +askopenfilenames |
| 17 | +---------------- |
| 18 | +.. autofunction:: tkfilebrowser.askopenfilenames |
44 | 19 |
|
45 | | - Allow the user to choose multiple files. A tuple containing the absolute |
46 | | - path of the chosen files is returned. If the user cancels, |
47 | | - an empty tuple is returned. |
48 | | - |
49 | | - Syntax: |
50 | | - |
51 | | - :: |
52 | | - |
53 | | - askopenfilenames(parent=None, title=_("Open"), **kwargs) |
| 20 | +asksaveasfilename |
| 21 | +----------------- |
| 22 | +.. autofunction:: tkfilebrowser.asksaveasfilename |
54 | 23 |
|
55 | | -- *asksaveasfilename* |
56 | 24 |
|
57 | | - Allow the user to choose a file path. The file may not exist but |
58 | | - the path to its directory does. If the file already exists, the user |
59 | | - is asked to confirm its replacement. |
| 25 | +FileBrowser |
| 26 | +----------- |
60 | 27 |
|
61 | | - Additional option: |
| 28 | +.. autoclass:: tkfilebrowser.FileBrowser |
| 29 | + :members: |
62 | 30 |
|
63 | | - defaultext : str (e.g. .png) |
64 | | - extension added to filename if none is given (default is none) |
65 | | - |
66 | | - Syntax: |
67 | | - |
68 | | - :: |
69 | | - |
70 | | - asksaveasfilename(parent=None, title=_("Save As"), **kwargs) |
71 | | - |
72 | | - |
73 | | -Optional keywords arguments common to all functions |
74 | | ---------------------------------------------------- |
75 | | - |
76 | | - parent : Tk or Toplevel instance |
77 | | - parent window |
78 | | - |
79 | | - title : str |
80 | | - the title of the filebrowser window |
81 | | - |
82 | | - initialdir : str |
83 | | - directory whose content is initially displayed |
84 | | - |
85 | | - initialfile : str |
86 | | - initially selected item (just the name, not the full path) |
87 | | - |
88 | | - filetypes : list ``[("name", "*.ext1|*.ext2|.."), ...]`` |
89 | | - only the files of given filetype will be displayed, |
90 | | - e.g. to allow the user to switch between displaying only PNG or JPG |
91 | | - pictures or dispalying all files: |
92 | | - filtypes=[("Pictures", "\*.png|\*.PNG|\*.jpg|\*.JPG'), ("All files", "\*")] |
93 | | - |
94 | | - okbuttontext : str |
95 | | - text displayed on the validate button, if None, the |
96 | | - default text corresponding to the mode is used (either "Open" or "Save") |
97 | | - |
98 | | - cancelbuttontext : str |
99 | | - text displayed on the button that cancels the selection. |
100 | | - |
101 | | - foldercreation : bool |
102 | | - enable the user to create new folders if True (default) |
| 31 | + .. automethod:: __init__ |
0 commit comments