/usr/share/gtk-doc/html/pygtk/class-gtkfilechooser.html is in python-gtk2-doc 2.24.0-5.1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.FileChooser</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtkexpander.html" title="gtk.Expander"><link rel="next" href="class-gtkfilechooserbutton.html" title="gtk.FileChooserButton"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.FileChooser</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkexpander.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkfilechooserbutton.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.FileChooser"><a name="class-gtkfilechooser"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.FileChooser</h2><p>gtk.FileChooser — an interface for choosing files used by <a class="link" href="class-gtkfilechooserwidget.html" title="gtk.FileChooserWidget"><code class="classname">gtk.FileChooserWidget</code></a>
and <a class="link" href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><code class="classname">gtk.FileChooserDialog</code></a>
(new in PyGTK 2.4)</p></div><div class="refsect1" title="Synopsis"><a name="id3698446"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.FileChooser</span></span>(<span class="ooclass"><span class="classname">gobject.GInterface</span></span>):
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-action" title="gtk.FileChooser.set_action">set_action</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-action" title="gtk.FileChooser.get_action">get_action</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-local-only" title="gtk.FileChooser.set_local_only">set_local_only</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>local_only</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-local-only" title="gtk.FileChooser.get_local_only">get_local_only</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-select-multiple" title="gtk.FileChooser.set_select_multiple">set_select_multiple</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>select_multiple</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-select-multiple" title="gtk.FileChooser.get_select_multiple">get_select_multiple</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-current-name" title="gtk.FileChooser.set_current_name">set_current_name</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-filename" title="gtk.FileChooser.get_filename">get_filename</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-filename" title="gtk.FileChooser.set_filename">set_filename</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--select-filename" title="gtk.FileChooser.select_filename">select_filename</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--unselect-filename" title="gtk.FileChooser.unselect_filename">unselect_filename</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--select-all" title="gtk.FileChooser.select_all">select_all</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--unselect-all" title="gtk.FileChooser.unselect_all">unselect_all</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-filenames" title="gtk.FileChooser.get_filenames">get_filenames</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-current-folder" title="gtk.FileChooser.set_current_folder">set_current_folder</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-current-folder" title="gtk.FileChooser.get_current_folder">get_current_folder</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-uri" title="gtk.FileChooser.get_uri">get_uri</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-uri" title="gtk.FileChooser.set_uri">set_uri</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--select-uri" title="gtk.FileChooser.select_uri">select_uri</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--unselect-uri" title="gtk.FileChooser.unselect_uri">unselect_uri</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-uris" title="gtk.FileChooser.get_uris">get_uris</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-current-folder-uri" title="gtk.FileChooser.set_current_folder_uri">set_current_folder_uri</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-current-folder-uri" title="gtk.FileChooser.get_current_folder_uri">get_current_folder_uri</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget">set_preview_widget</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>preview_widget</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-widget" title="gtk.FileChooser.get_preview_widget">get_preview_widget</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget-active" title="gtk.FileChooser.set_preview_widget_active">set_preview_widget_active</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>active</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-widget-active" title="gtk.FileChooser.get_preview_widget_active">get_preview_widget_active</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-use-preview-label" title="gtk.FileChooser.set_use_preview_label">set_use_preview_label</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_label</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-use-preview-label" title="gtk.FileChooser.get_use_preview_label">get_use_preview_label</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-filename" title="gtk.FileChooser.get_preview_filename">get_preview_filename</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-uri" title="gtk.FileChooser.get_preview_uri">get_preview_uri</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-extra-widget" title="gtk.FileChooser.set_extra_widget">set_extra_widget</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>extra_widget</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-extra-widget" title="gtk.FileChooser.get_extra_widget">get_extra_widget</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-filter" title="gtk.FileChooser.add_filter">add_filter</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filter</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--remove-filter" title="gtk.FileChooser.remove_filter">remove_filter</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filter</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--list-filters" title="gtk.FileChooser.list_filters">list_filters</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-filter" title="gtk.FileChooser.set_filter">set_filter</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filter</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-filter" title="gtk.FileChooser.get_filter">get_filter</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-shortcut-folder" title="gtk.FileChooser.add_shortcut_folder">add_shortcut_folder</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>folder</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--remove-shortcut-folder" title="gtk.FileChooser.remove_shortcut_folder">remove_shortcut_folder</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>folder</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--list-shortcut-folders" title="gtk.FileChooser.list_shortcut_folders">list_shortcut_folders</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-shortcut-folder-uri" title="gtk.FileChooser.add_shortcut_folder_uri">add_shortcut_folder_uri</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--remove-shortcut-folder-uri" title="gtk.FileChooser.remove_shortcut_folder_uri">remove_shortcut_folder_uri</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--list-shortcut-folder-uris" title="gtk.FileChooser.list_shortcut_folder_uris">list_shortcut_folder_uris</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-show-hidden" title="gtk.FileChooser.set_show_hidden">set_show_hidden</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>show_hidden</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-show-hidden" title="gtk.FileChooser.get_show_hidden">get_show_hidden</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-do-overwrite-confirmation" title="gtk.FileChooser.set_do_overwrite_confirmation">set_do_overwrite_confirmation</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>do_overwrite_confirmation</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-do-overwrite-confirmation" title="gtk.FileChooser.get_do_overwrite_confirmation">get_do_overwrite_confirmation</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-current-folder-file" title="gtk.FileChooser.get_current_folder_file">get_current_folder_file</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-file" title="gtk.FileChooser.get_file">get_file</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-file" title="gtk.FileChooser.get_preview_file">get_preview_file</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--select-file" title="gtk.FileChooser.select_file">select_file</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>file</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-current-folder-file" title="gtk.FileChooser.set_current_folder_file">set_current_folder_file</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>file</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-file" title="gtk.FileChooser.set_file">set_file</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>file</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--unselect-file" title="gtk.FileChooser.unselect_file">unselect_file</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>file</code></strong></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" title="gtk.FileChooser Properties"><a name="properties-gtkfilechooser"></a><h2>gtk.FileChooser Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"action"</td><td valign="top">Read-Write</td><td valign="top">The type of operation that the file selector is
performing - one of the <a class="xref" href="gtk-constants.html#gtk-filechooser-action-constants" title="GTK FileChooser Action Constants">GTK FileChooser Action Constants</a>. Default
value: <code class="literal">gtk.FILE_CHOOSER_ACTION_OPEN</code></td></tr><tr valign="top"><td valign="top">"do-overwrite-confirmation"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code> a file chooser in
<code class="literal">gtk.FILE_CHOOSER_ACTION_SAVE</code> will present
an overwrite confirmation dialog if the user selects a file
name that already exists. Default value:
<code class="literal">False</code>. This property is available in GTK+
2.8 and above</td></tr><tr valign="top"><td valign="top">"extra-widget"</td><td valign="top">Read-Write</td><td valign="top">An application supplied widget for extra options.</td></tr><tr valign="top"><td valign="top">"file-system-backend"</td><td valign="top">Write-Construct</td><td valign="top">The name of the file system backend to use.
Default value: <code class="literal">None</code></td></tr><tr valign="top"><td valign="top">"filter"</td><td valign="top">Read-Write</td><td valign="top">The current <a class="link" href="class-gtkfilefilter.html" title="gtk.FileFilter"><code class="classname">gtk.FileFilter</code></a>
for selecting which files are displayed.</td></tr><tr valign="top"><td valign="top">"local-only"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, the selected file(s) should
be limited to local file: URLs. Default value: <code class="literal">True</code></td></tr><tr valign="top"><td valign="top">"preview-widget"</td><td valign="top">Read-Write</td><td valign="top">An application supplied widget for custom
previews.</td></tr><tr valign="top"><td valign="top">"preview-widget-active"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, the application supplied
widget for custom previews should be shown. Default value:
<code class="literal">True</code></td></tr><tr valign="top"><td valign="top">"select-multiple"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, allow multiple files to be
selected except if
<code class="literal">gtk.FILE_CHOOSER_ACTION_SAVE</code> is set as the
"action" property. Default value:
<code class="literal">False</code></td></tr><tr valign="top"><td valign="top">"show-hidden"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, hidden files and folders
should be displayed. Default value: <code class="literal">False</code></td></tr><tr valign="top"><td valign="top">"use-preview-label"</td><td valign="top">Read-Write</td><td valign="top">If <code class="literal">True</code>, display a stock label with
the name of the previewed file. Default value: <code class="literal">True</code></td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.FileChooser Signal Prototypes"><a name="signal-prototypes-gtkfilechooser"></a><h2>gtk.FileChooser Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">"<a class="link" href="class-gtkfilechooser.html#signal-gtkfilechooser--confirm-overwrite" title='The "confirm-overwrite" gtk.FileChooser Signal'>confirm-overwrite</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkfilechooser.html#signal-gtkfilechooser--current-folder-changed" title='The "current-folder-changed" gtk.FileChooser Signal'>current-folder-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkfilechooser.html#signal-gtkfilechooser--file-activated" title='The "file-activated" gtk.FileChooser Signal'>file-activated</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkfilechooser.html#signal-gtkfilechooser--selection-changed" title='The "selection-changed" gtk.FileChooser Signal'>selection-changed</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr><tr><td><p><span class="term">"<a class="link" href="class-gtkfilechooser.html#signal-gtkfilechooser--update-preview" title='The "update-preview" gtk.FileChooser Signal'>update-preview</a>"</span></p></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" title="Description"><a name="id3700505"></a><h2>Description</h2><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This interface is available in PyGTK 2.4 and above.</p></div><p><a class="link" href="class-gtkfilechooser.html" title="gtk.FileChooser"><code class="classname">gtk.FileChooser</code></a>
is an interface that can be implemented by file selection widgets. In PyGTK,
the main objects that implement this interface are <a class="link" href="class-gtkfilechooserwidget.html" title="gtk.FileChooserWidget"><code class="classname">gtk.FileChooserWidget</code></a>
and <a class="link" href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><code class="classname">gtk.FileChooserDialog</code></a>. You
do not need to write an object that implements the <a class="link" href="class-gtkfilechooser.html" title="gtk.FileChooser"><code class="classname">gtk.FileChooser</code></a>
interface unless you are trying to adapt an existing file selector to expose
a standard programming interface.</p><p><a class="link" href="class-gtkfilechooser.html" title="gtk.FileChooser"><code class="classname">gtk.FileChooser</code></a>
has several elements to its display:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p class="simpara">a list of shortcut folders on the left that is divided into
two lists by a horizontal line:</p><div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem">a default list of folders usually including "Home" and
"Filesystem" with folders added using the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-shortcut-folder" title="gtk.FileChooser.add_shortcut_folder"><code class="methodname">add_shortcut_folder</code>()</a>
or <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-shortcut-folder-uri" title="gtk.FileChooser.add_shortcut_folder_uri"><code class="methodname">add_shortcut_folder_uri</code>()</a>
methods.</li><li class="listitem">a list of user specified shortcut folders managed using
the "Add" and "Remove" buttons at the bottom of the file chooser.</li></ul></div></li><li class="listitem">the "Add" and "Remove" buttons that allow a user to add or
remove a folder to or from the user's shortcut folder list.</li><li class="listitem">the current folder path as a series of buttons above the
file selection window. The buttons can be clicked to jump to the associated
ancestor folder.</li><li class="listitem">the file selection window that displays the contents of the
current folder in alphabetical order with last modified time.</li></ul></div><div class="refsect2" title="File Names and Encodings"><a name="FileNamesAndEncodings"></a><h3>File Names and Encodings</h3><p>When the user is finished selecting files in a <a class="link" href="class-gtkfilechooser.html" title="gtk.FileChooser"><code class="classname">gtk.FileChooser</code></a>,
your program can get the selected names either as filenames or as
URIs. For URIs, the normal escaping rules are applied if the URI
contains non-ASCII characters. However, filenames are always returned
in the character set specified by the result of calling the Python
sys.getfilesystemencoding() function. On POSIX this is the actual
on-disk encoding which might correspond to the locale settings of the
process, or not. On Windows the file name encoding is UTF-8. Note that
the Microsoft C library does not use UTF-8, but has separate APIs for
current system code page and wide characters (UTF-16).</p><div class="important" title="Important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>This means that while you can pass the result of <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-filename" title="gtk.FileChooser.get_filename"><code class="methodname">get_filename</code>()</a>
to open() or os.open(), you may not be able to directly set it as
the text of a <a class="link" href="class-gtklabel.html" title="gtk.Label"><code class="classname">gtk.Label</code></a>
widget unless you convert it first to UTF-8, which all PyGTK widgets
expect. If necessary you should use the Python codecs to convert
filenames into strings that can be passed to PyGTK widgets.</p></div></div><div class="refsect2" title="Adding A Preview Widget"><a name="AddingAPreviewWidget"></a><h3>Adding A Preview Widget</h3><p>You can add a custom preview widget to a file chooser and get
notification when the preview needs to be updated. To install a preview
widget, use the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget</code>()</a>
method. Then, connect to the "update-preview" signal to be notified when
you need to update the contents of the preview.</p><p>Your callback should use the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-filename" title="gtk.FileChooser.get_preview_filename"><code class="methodname">get_preview_filename</code>()</a>
method to see what needs previewing. Once you have generated the preview for
the corresponding file, you must call the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget-active" title="gtk.FileChooser.set_preview_widget_active"><code class="methodname">set_preview_widget_active</code>()</a>
method with a boolean flag that indicates whether your callback could
successfully generate a preview. An example use of a custom preview
is:</p><pre class="programlisting">
...
preview = gtk.Image()
my_file_chooser.set_preview_widget(preview)
my_file_chooser.connect("update-preview", update_preview_cb, preview)
...
def update_preview_cb(file_chooser, preview):
filename = file_chooser.get_preview_filename()
try:
pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, 128, 128)
preview.set_from_pixbuf(pixbuf)
have_preview = True
except:
have_preview = False
file_chooser.set_preview_widget_active(have_preview)
return
...
</pre></div><div class="refsect2" title="Adding Extra Widgets"><a name="id3700782"></a><h3>Adding Extra Widgets</h3><p> You can add extra widgets to a file chooser to provide options
that are not present in the default design. For example, you can add a <a class="link" href="class-gtktogglebutton.html" title="gtk.ToggleButton"><code class="classname">gtk.ToggleButton</code></a>
to give the user the option to open a file in read-only mode. You can use
the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-extra-widget" title="gtk.FileChooser.set_extra_widget"><code class="methodname">set_extra_widget</code>()</a>
method to insert additional widgets in a file chooser. For example:</p><pre class="programlisting">
toggle = gtk.CheckButton("Open file read-only")
toggle.show ()
my_file_chooser.set_extra_widget(toggle)
</pre><p> If you want to set more than one extra widget in the file
chooser, you can use a container such as a <a class="link" href="class-gtkvbox.html" title="gtk.VBox"><code class="classname">gtk.VBox</code></a> or a <a class="link" href="class-gtktable.html" title="gtk.Table"><code class="classname">gtk.Table</code></a> to hold
your widgets; then set the container as the whole extra widget.</p></div><div class="refsect2" title="Key Bindings"><a name="id3700843"></a><h3>Key Bindings</h3><p>The <a class="link" href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><code class="classname">gtk.FileChooserDialog</code></a>
uses the private <code class="classname">GtkFileChooserDefaultClass</code> that has
several key bindings and their associated signals. This section describes
the available key binding signals.</p><p>The default keys that activate the key-binding signals in GtkFileChooserDefaultClass are as follows:</p><div class="informaltable"><table width="100%" border="0"><colgroup><col width="2in"><col width="2in"></colgroup><thead><tr><th>Signal name</th><th>Key</th></tr></thead><tbody><tr><td>location-popup</td><td>Control-L</td></tr><tr><td>up-folder</td><td>Alt-Up</td></tr><tr><td>down-folder</td><td>Alt-Down</td></tr><tr><td>home-folder</td><td>Alt-Home</td></tr></tbody></table></div><p>To change these defaults to something else, you could include
the following fragment in your <code class="filename">.gtkrc-2.0</code> file:</p><pre class="programlisting">
binding "my-own-gtkfilechooser-bindings" {
bind "<Alt><Shift>l" {
"location-popup" ()
}
bind "<Alt><Shift>Up" {
"up-folder" ()
}
bind "<Alt><Shift>Down" {
"down-folder" ()
}
bind "<Alt><Shift>Home" {
"home-folder-folder" ()
}
}
class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
</pre><p>The "GtkFileChooserDefault::location-popup" signal is used to
make the file chooser show a "Location" dialog which the user can use to
manually type the name of the file he wishes to select. By default this is
bound to
<span class="keycap"><strong>Control</strong></span>+<span class="keycap"><strong>L</strong></span>.</p><pre class="programlisting">
def location_popup_cb(filechooser, user_data):
</pre><p>where <em class="parameter"><code>filechooser</code></em> is the <a class="link" href="class-gtkfilechooser.html" title="gtk.FileChooser"><code class="classname">gtk.FileChooser</code></a>
that received the signal, <em class="parameter"><code>user_data</code></em> is user data set
when the signal handler was connected.</p><p>The "GtkFileChooserDefault::up-folder" signal is used to make
the file chooser go to the parent of the current folder in the file
hierarchy. By default this is bound to
<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>Up</strong></span>.</p><pre class="programlisting">
def up_folder_cb(filechooser, user_data):
</pre><p>where <em class="parameter"><code>filechooser</code></em> is the object that
received the signal and <em class="parameter"><code>user_data</code></em> is the user data
set when the signal handler was connected.</p><p>The "GtkFileChooserDefault::down-folder" signal is used to make
the file chooser go to a child of the current folder in the file
hierarchy. The subfolder that will be used is displayed in the path bar
widget of the file chooser. For example, if the path bar is showing
"/foo/bar/baz", then this will cause the file chooser to switch to the "baz"
subfolder. By default this is bound to
<span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>Down</strong></span>.</p><pre class="programlisting">
def down_folder_cb(filechooser, user_data):
</pre><p>where <em class="parameter"><code>filechooser</code></em> is the object that
received the signal and <em class="parameter"><code>user_data</code></em> is the user data
set when the signal handler was connected.</p><p>The "GtkFileChooserDefault::home-folder" signal is used to make
the file chooser show the user's home folder in the file list. By default
this is bound to <span class="keycap"><strong>Alt</strong></span>+<span class="keycap"><strong>Home</strong></span>.</p><pre class="programlisting">
def home_folder_cb(filechooser, user_data):
</pre><p>where <em class="parameter"><code>filechooser</code></em> is the object that
received the signal and <em class="parameter"><code>user_data</code></em> is the user data
set when the signal handler was connected.</p></div></div><div class="refsect1" title="Methods"><a name="id3701184"></a><h2>Methods</h2><div class="refsect2" title="gtk.FileChooser.set_action"><a name="method-gtkfilechooser--set-action"></a><h3>gtk.FileChooser.set_action</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_action</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>action</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>action</code></strong> :</span></p></td><td>the file selection action - one of:
<code class="literal">gtk.FILE_CHOOSER_ACTION_OPEN</code>,
<code class="literal">gtk.FILE_CHOOSER_ACTION_SAVE</code>,
<code class="literal">gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER</code> or
<code class="literal">gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER</code>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_action</code>() method sets the
"action" property to the value of <em class="parameter"><code>action</code></em>. The type of
operation that that the chooser is performing is set by
<em class="parameter"><code>action</code></em> causing the user interface to be changed to
suit the selected action. The value of <em class="parameter"><code>action</code></em> must be
one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">gtk.FILE_CHOOSER_ACTION_OPEN</code></span></p></td><td>Indicates open mode. The file chooser will only let the
user pick an existing file.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.FILE_CHOOSER_ACTION_SAVE</code></span></p></td><td>Indicates save mode. The file chooser will let the user
pick an existing file, or type in a new filename.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER</code></span></p></td><td>Indicates an open mode for selecting folders. The file
chooser will let the user pick an existing folder.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER</code></span></p></td><td>Indicates a mode for creating a new folder. The file
chooser will let the user name an existing or new folder </td></tr></tbody></table><p>For example, an option to create a new folder might be shown if
the action is <code class="literal">gtk.FILE_CHOOSER_ACTION_SAVE</code> but not if the
action is <code class="literal">gtk.FILE_CHOOSER_ACTION_OPEN</code>.</p></div><div class="refsect2" title="gtk.FileChooser.get_action"><a name="method-gtkfilechooser--get-action"></a><h3>gtk.FileChooser.get_action</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_action</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the action that is set for the file
selector</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_action</code>() method returns the
value of the "action" property that indicates the type of operation that the
file chooser is set to perform. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-action" title="gtk.FileChooser.set_action"><code class="methodname">set_action()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.set_local_only"><a name="method-gtkfilechooser--set-local-only"></a><h3>gtk.FileChooser.set_local_only</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_local_only</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>local_only</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>local_only</code></strong> :</span></p></td><td>if <code class="literal">True</code>, only local files can
be selected</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_local_only</code>() method sets the
"local-only" property to the value of <em class="parameter"><code>local_only</code></em>. If
<em class="parameter"><code>local_only</code></em> is <code class="literal">True</code> (the default),
only local files can be selected in the file selector and the selected files
are guaranteed to be accessible through the operating system's native file
system. Therefore, the application only needs to use the filename methods in
<a class="link" href="class-gtkfilechooser.html" title="gtk.FileChooser"><code class="classname">gtk.FileChooser</code></a>.
For example, the application can use the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-filename" title="gtk.FileChooser.get_filename"><code class="methodname">get_filename()</code></a>
method instead of the URI method <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-uri" title="gtk.FileChooser.get_uri"><code class="methodname">get_uri()</code></a>.</p></div><div class="refsect2" title="gtk.FileChooser.get_local_only"><a name="method-gtkfilechooser--get-local-only"></a><h3>gtk.FileChooser.get_local_only</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_local_only</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if only local files can be
selected.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_local_only</code>() method returns the
value of the "local-only" property that indicates whether only local files
can be selected in the file selector. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-local-only" title="gtk.FileChooser.set_local_only"><code class="methodname">set_local_only()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.set_select_multiple"><a name="method-gtkfilechooser--set-select-multiple"></a><h3>gtk.FileChooser.set_select_multiple</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_select_multiple</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>select_multiple</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>select_multiple</code></strong> :</span></p></td><td>if <code class="literal">True</code> multiple files can be
selected.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_select_multiple</code>() method sets
the "select_multiple" property to the value of
<em class="parameter"><code>select_multiple</code></em>. If
<em class="parameter"><code>select_multiple</code></em> is <code class="literal">True</code>, multiple
files can be selected in the file selector.</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The "select-multiple" property cannot be set
<code class="literal">True</code> when the file chooser action is
<code class="literal">gtk.FILE_CHOOSER_ACTION_SAVE</code> or
<code class="literal">gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER</code>.</p></div></div><div class="refsect2" title="gtk.FileChooser.get_select_multiple"><a name="method-gtkfilechooser--get-select-multiple"></a><h3>gtk.FileChooser.get_select_multiple</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_select_multiple</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if multiple files can be
selected.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_select_multiple</code>() method
returns the value of the "select_multiple" property that indicates whether
multiple files can be selected in the file selector. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-select-multiple" title="gtk.FileChooser.set_select_multiple"><code class="methodname">set_select_multiple()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.set_current_name"><a name="method-gtkfilechooser--set-current-name"></a><h3>gtk.FileChooser.set_current_name</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_current_name</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>name</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>name</code></strong> :</span></p></td><td>the filename to use, as a UTF-8
string</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_current_name</code>() method sets the
current name in the file selector to the value of
<em class="parameter"><code>name</code></em>, as if entered by the user. Note that the name
passed in here is a UTF-8 string rather than a filename. This method is
meant for such uses as a suggested name in a "Save As..." dialog.</p><p>If you want to preselect a particular existing file, you should
use the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-filename" title="gtk.FileChooser.set_filename"><code class="methodname">set_filename()</code></a>
method instead.</p></div><div class="refsect2" title="gtk.FileChooser.get_filename"><a name="method-gtkfilechooser--get-filename"></a><h3>gtk.FileChooser.get_filename</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_filename</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The currently selected filename, or
<code class="literal">None</code> if no file is selected, or the selected file can't
be represented with a local filename.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_filename</code>() method returns the
filename of the currently selected file in the file selector. If multiple
files are selected, one of the filenames will be returned at random. If the
file chooser is in folder mode, this function returns the selected
folder.</p></div><div class="refsect2" title="gtk.FileChooser.set_filename"><a name="method-gtkfilechooser--set-filename"></a><h3>gtk.FileChooser.set_filename</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_filename</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filename</code></strong> :</span></p></td><td>the filename to set as current</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if both the folder could
be changed and the file was selected successfully, <code class="literal">False</code>
otherwise.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_filename</code>() method sets
<em class="parameter"><code>filename</code></em> as the current filename for the the file
chooser. If the file name isn't in the current folder of the chooser, then
the current folder of the chooser will be changed to the folder containing
<em class="parameter"><code>filename</code></em>. This is equivalent to a sequence of <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--unselect-all" title="gtk.FileChooser.unselect_all"><code class="methodname">unselect_all()</code></a>
followed by <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--select-filename" title="gtk.FileChooser.select_filename"><code class="methodname">select_filename()</code></a>.</p><p>Note that the file must exist, or nothing will be done except
for the directory change. To pre-enter a filename for the user, as in a
"Save as ..." dialog, use the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-current-name" title="gtk.FileChooser.set_current_name"><code class="methodname">set_current_name()</code></a>
method.</p></div><div class="refsect2" title="gtk.FileChooser.select_filename"><a name="method-gtkfilechooser--select-filename"></a><h3>gtk.FileChooser.select_filename</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">select_filename</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filename</code></strong> :</span></p></td><td>the filename to select</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if both the folder could
be changed and the file was selected successfully, <code class="literal">False</code>
otherwise.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">select_filename</code>() method selects
the filename specified by <em class="parameter"><code>filename</code></em>. If
<em class="parameter"><code>filename</code></em> isn't in the current folder of the chooser,
then the current folder of the chooser will be changed to the folder
containing <em class="parameter"><code>filename</code></em>.</p></div><div class="refsect2" title="gtk.FileChooser.unselect_filename"><a name="method-gtkfilechooser--unselect-filename"></a><h3>gtk.FileChooser.unselect_filename</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">unselect_filename</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filename</code></strong> :</span></p></td><td>the filename to unselect</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">unselect_filename</code>() method
unselects the currently selected filename specified by
<em class="parameter"><code>filename</code></em>. If <em class="parameter"><code>filename</code></em> is not
in the current directory, does not exist, or is otherwise not currently
selected, this method does nothing.</p></div><div class="refsect2" title="gtk.FileChooser.select_all"><a name="method-gtkfilechooser--select-all"></a><h3>gtk.FileChooser.select_all</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">select_all</span>(<span class="methodparam"></span>)</code></pre><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">select_all</code>() method selects all the
files in the current folder of a file chooser.</p></div><div class="refsect2" title="gtk.FileChooser.unselect_all"><a name="method-gtkfilechooser--unselect-all"></a><h3>gtk.FileChooser.unselect_all</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">unselect_all</span>(<span class="methodparam"></span>)</code></pre><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">unselect_all</code>() method unselects all
the files in the current folder of a file chooser.</p></div><div class="refsect2" title="gtk.FileChooser.get_filenames"><a name="method-gtkfilechooser--get-filenames"></a><h3>gtk.FileChooser.get_filenames</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_filenames</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list containing the filenames of all selected
files and subfolders in the current folder.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_filenames</code>() method returns a
list containing all the selected files and subfolders in the current folder
of the chooser. The returned names are full absolute paths. If files in the
current folder cannot be represented as local filenames they will be
ignored. (See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-uris" title="gtk.FileChooser.get_uris"><code class="methodname">get_uris()</code></a>
method for more information)</p></div><div class="refsect2" title="gtk.FileChooser.set_current_folder"><a name="method-gtkfilechooser--set-current-folder"></a><h3>gtk.FileChooser.set_current_folder</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_current_folder</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filename</code></strong> :</span></p></td><td>the full path of the new current
folder</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the folder could be
changed successfully, <code class="literal">False</code> otherwise.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_current_folder</code>() method sets
the current folder for the chooser to the local filename specified by
<em class="parameter"><code>filename</code></em>. The user will be shown the full contents
of the current folder, plus user interface elements for navigating to other
folders.</p></div><div class="refsect2" title="gtk.FileChooser.get_current_folder"><a name="method-gtkfilechooser--get-current-folder"></a><h3>gtk.FileChooser.get_current_folder</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_current_folder</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the full path of the current folder, or
<code class="literal">None</code> if the current path cannot be represented as a local
filename.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_current_folder</code>() method returns
the current folder of the chooser as a local filename. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-current-folder" title="gtk.FileChooser.set_current_folder"><code class="methodname">set_current_folder()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.get_uri"><a name="method-gtkfilechooser--get-uri"></a><h3>gtk.FileChooser.get_uri</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_uri</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The currently selected URI, or
<code class="literal">None</code> if no file is selected.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_uri</code>() method returns the URI
for the currently selected file in the file selector. If multiple files are
selected, one of the filenames will be returned at random. If the file
chooser is in folder mode, this function returns the selected folder.</p></div><div class="refsect2" title="gtk.FileChooser.set_uri"><a name="method-gtkfilechooser--set-uri"></a><h3>gtk.FileChooser.set_uri</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_uri</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>uri</code></strong> :</span></p></td><td>the URI to set as the current
file</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if both the folder could
be changed and the URI was successfully selected.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_uri</code>() method sets the file
referred to by <em class="parameter"><code>uri</code></em> as the current file for the file
chooser; If the file name isn't in the current folder of the chooser, then
the current folder of the chooser will be changed to the folder containing
<em class="parameter"><code>uri</code></em>. This is equivalent to the sequence of <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--unselect-all" title="gtk.FileChooser.unselect_all"><code class="methodname">unselect_all()</code></a>
followed by <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--select-uri" title="gtk.FileChooser.select_uri"><code class="methodname">select_uri()</code></a>.
Note that the file must exist, or nothing will be done except for the
directory change. To pre-enter a filename for the user, as in a "Save As
..." dialog, use the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-current-name" title="gtk.FileChooser.set_current_name"><code class="methodname">set_current_name()</code></a>
method.</p></div><div class="refsect2" title="gtk.FileChooser.select_uri"><a name="method-gtkfilechooser--select-uri"></a><h3>gtk.FileChooser.select_uri</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">select_uri</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>uri</code></strong> :</span></p></td><td>the URI of the file to select</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if both the folder could
be changed and the URI was successfully selected.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">select_uri</code>() method selects the
file referred to by <em class="parameter"><code>uri</code></em>. If the URI doesn't refer to
a file in the current folder of the chooser, then the current folder of the
chooser will be changed to the folder containing the file referenced by
<em class="parameter"><code>uri</code></em>.</p></div><div class="refsect2" title="gtk.FileChooser.unselect_uri"><a name="method-gtkfilechooser--unselect-uri"></a><h3>gtk.FileChooser.unselect_uri</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">unselect_uri</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>uri</code></strong> :</span></p></td><td>the URI of the file to
unselect</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">unselect_uri</code>() method unselects the
file referred to by <em class="parameter"><code>uri</code></em>. If the file is not in the
current directory, does not exist, or is otherwise not currently selected,
this method does nothing.</p></div><div class="refsect2" title="gtk.FileChooser.get_uris"><a name="method-gtkfilechooser--get-uris"></a><h3>gtk.FileChooser.get_uris</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_uris</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list containing the URIs of all selected
files and subfolders in the current folder.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_uris</code>() method returns a list
containing all the selected files and subfolders in the current folder of
the chooser. The returned names are full absolute URIs.</p></div><div class="refsect2" title="gtk.FileChooser.set_current_folder_uri"><a name="method-gtkfilechooser--set-current-folder-uri"></a><h3>gtk.FileChooser.set_current_folder_uri</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_current_folder_uri</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>uri</code></strong> :</span></p></td><td>the URI for the new current
folder</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the folder could be
changed successfully, <code class="literal">False</code> otherwise.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_current_folder_uri</code>() method
sets the current folder for the chooser to the folder referenced by
<em class="parameter"><code>uri</code></em>. The user will be shown the full contents of the
current folder, plus user interface elements for navigating to other
folders.</p></div><div class="refsect2" title="gtk.FileChooser.get_current_folder_uri"><a name="method-gtkfilechooser--get-current-folder-uri"></a><h3>gtk.FileChooser.get_current_folder_uri</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_current_folder_uri</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the URI for the current
folder.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_current_folder_uri</code>() method
returns the URI reference of the current folder of the chooser. See the
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-current-folder-uri" title="gtk.FileChooser.set_current_folder_uri"><code class="methodname">set_current_folder_uri()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.set_preview_widget"><a name="method-gtkfilechooser--set-preview-widget"></a><h3>gtk.FileChooser.set_preview_widget</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_preview_widget</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>preview_widget</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>preview_widget</code></strong> :</span></p></td><td>a widget for displaying a
preview.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_preview_widget</code>() method sets
the "preview-widget" property to the value of
<em class="parameter"><code>preview_widget</code></em>. The
<em class="parameter"><code>preview_widget</code></em> is used to preview the currently
selected file. To implement a custom preview:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">set the preview widget</li><li class="listitem">connect a callback to the "selection-changed" signal of the
file chooser</li><li class="listitem">in the callback, call the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-filename" title="gtk.FileChooser.get_preview_filename"><code class="methodname">get_preview_filename()</code></a>
method or the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-uri" title="gtk.FileChooser.get_preview_uri"><code class="methodname">get_preview_uri()</code></a>
method to retrieve the selected file name or URI</li><li class="listitem">if you can, display a preview of the selected file and set
the preview active using the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget-active" title="gtk.FileChooser.set_preview_widget_active"><code class="methodname">set_preview_widget_active()</code></a>
method</li><li class="listitem">otherwise, set the preview inactive</li></ul></div><p>When there is no application-supplied preview widget, or the
application-supplied preview widget is not active, the file chooser
may display an internally generated preview of the current file or
it may display no preview at all.</p></div><div class="refsect2" title="gtk.FileChooser.get_preview_widget"><a name="method-gtkfilechooser--get-preview-widget"></a><h3>gtk.FileChooser.get_preview_widget</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_preview_widget</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the current preview widget, or
<code class="literal">None</code></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_preview_widget</code>() method returns
the value of the "preview_widget" property i.e. the current preview
widget. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.set_preview_widget_active"><a name="method-gtkfilechooser--set-preview-widget-active"></a><h3>gtk.FileChooser.set_preview_widget_active</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_preview_widget_active</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>active</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>active</code></strong> :</span></p></td><td>if <code class="literal">True</code>, display the
user-specified preview widget</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_preview_widget_active</code>() method
sets the "preview_widget_active" property to the value of
<em class="parameter"><code>active</code></em>. If <em class="parameter"><code>active</code></em> is
<code class="literal">True</code>, the preview widget set by the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget()</code></a>
method should be shown for the current filename. When
<em class="parameter"><code>active</code></em> is <code class="literal">False</code>, the file chooser
may display an internally generated preview of the current file or it may
display no preview at all. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget()</code></a>
for more details.</p></div><div class="refsect2" title="gtk.FileChooser.get_preview_widget_active"><a name="method-gtkfilechooser--get-preview-widget-active"></a><h3>gtk.FileChooser.get_preview_widget_active</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_preview_widget_active</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the preview widget is
active for the current filename.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_preview_widget_active</code>() method
returns the value of the "preview-widget-active" property that indicates
whether the preview widget set by the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget()</code></a>
method should be shown for the current filename. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget-active" title="gtk.FileChooser.set_preview_widget_active"><code class="methodname">set_preview_widget_active()</code></a>
method for more details.</p></div><div class="refsect2" title="gtk.FileChooser.set_use_preview_label"><a name="method-gtkfilechooser--set-use-preview-label"></a><h3>gtk.FileChooser.set_use_preview_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_use_preview_label</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>use_label</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>use_label</code></strong> :</span></p></td><td>if <code class="literal">True</code>, display a stock label
with the name of the previewed file</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_use_preview_label</code>() method sets
the "use-preview-label" property to the value of
<em class="parameter"><code>use_label</code></em>. If <em class="parameter"><code>use_label</code></em> is
<code class="literal">True</code> (the default), the file chooser should display a
stock label with the name of the file that is being previewed. Applications
that want to draw the whole preview area themselves should set this to
<code class="literal">False</code> and display the name themselves in their preview
widget. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.get_use_preview_label"><a name="method-gtkfilechooser--get-use-preview-label"></a><h3>gtk.FileChooser.get_use_preview_label</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_use_preview_label</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the file chooser is
set to display a label with the name of the previewed file;
<code class="literal">False</code> otherwise.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_use_preview_label</code>() method
returns the value of the "use-preview-label" property that indicates whether
a stock label should be drawn with the name of the previewed file. See the
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-use-preview-label" title="gtk.FileChooser.set_use_preview_label"><code class="methodname">set_use_preview_label()</code></a>
for more information.</p></div><div class="refsect2" title="gtk.FileChooser.get_preview_filename"><a name="method-gtkfilechooser--get-preview-filename"></a><h3>gtk.FileChooser.get_preview_filename</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_preview_filename</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the filename to preview, or
<code class="literal">None</code>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_preview_filename</code>() method
returns the filename that should be previewed in a custom preview widget or
<code class="literal">None</code> if no file is selected, or if the selected file
cannot be represented as a local filename. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget()</code></a>
method for more details.</p></div><div class="refsect2" title="gtk.FileChooser.get_preview_uri"><a name="method-gtkfilechooser--get-preview-uri"></a><h3>gtk.FileChooser.get_preview_uri</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_preview_uri</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the URI for the file to preview, or
<code class="literal">None</code>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_preview_uri</code>() method returns
the URI of the file that should be previewed in a custom preview widget or
<code class="literal">None</code> if no file is selected. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget()</code></a>
method fr more details.</p></div><div class="refsect2" title="gtk.FileChooser.set_extra_widget"><a name="method-gtkfilechooser--set-extra-widget"></a><h3>gtk.FileChooser.set_extra_widget</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_extra_widget</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>extra_widget</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>extra_widget</code></strong> :</span></p></td><td>the widget to display extra
options</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_extra_widget</code>() method sets the
"extra-widget" property to the value of
<em class="parameter"><code>extra_widget</code></em>. <em class="parameter"><code>extra_widget</code></em> is
an application-supplied widget used to display extra options to the
user.</p></div><div class="refsect2" title="gtk.FileChooser.get_extra_widget"><a name="method-gtkfilechooser--get-extra-widget"></a><h3>gtk.FileChooser.get_extra_widget</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_extra_widget</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the current extra widget, or
<code class="literal">None</code>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_extra_widget</code>() method returns
the value of the "extra-widget" property that contains either a widget used
to display extra options to the user or <code class="literal">None</code> if no extra
widget is in use. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-extra-widget" title="gtk.FileChooser.set_extra_widget"><code class="methodname">set_extra_widget()</code></a>
for more information.</p></div><div class="refsect2" title="gtk.FileChooser.add_filter"><a name="method-gtkfilechooser--add-filter"></a><h3>gtk.FileChooser.add_filter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_filter</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filter</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filter</code></strong> :</span></p></td><td>a
<a class="link" href="class-gtkfilefilter.html" title="gtk.FileFilter"><code class="classname">gtk.FileFilter</code></a></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">add_filter</code>() method adds the <a class="link" href="class-gtkfilefilter.html" title="gtk.FileFilter"><code class="classname">gtk.FileFilter</code></a>
specified by <em class="parameter"><code>filter</code></em> to the list of filters that the
user can select from. When a filter is selected, only files that are
passed by that filter are displayed.</p></div><div class="refsect2" title="gtk.FileChooser.remove_filter"><a name="method-gtkfilechooser--remove-filter"></a><h3>gtk.FileChooser.remove_filter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove_filter</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filter</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filter</code></strong> :</span></p></td><td>a
<a class="link" href="class-gtkfilefilter.html" title="gtk.FileFilter"><code class="classname">gtk.FileFilter</code></a></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">remove_filter</code>() method removes the
<a class="link" href="class-gtkfilefilter.html" title="gtk.FileFilter"><code class="classname">gtk.FileFilter</code></a>
specified by <em class="parameter"><code>filter</code></em> from the list of filters that the
user can select from.</p></div><div class="refsect2" title="gtk.FileChooser.list_filters"><a name="method-gtkfilechooser--list-filters"></a><h3>gtk.FileChooser.list_filters</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">list_filters</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list containing the current set of
user selectable filters.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">list_filters</code>() method returns the
current set of user-selectable filters. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-filter" title="gtk.FileChooser.add_filter"><code class="methodname">add_filter()</code></a>
and <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--remove-filter" title="gtk.FileChooser.remove_filter"><code class="methodname">remove_filter()</code></a>
method for more details.</p></div><div class="refsect2" title="gtk.FileChooser.set_filter"><a name="method-gtkfilechooser--set-filter"></a><h3>gtk.FileChooser.set_filter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_filter</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filter</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filter</code></strong> :</span></p></td><td>a
<a class="link" href="class-gtkfilefilter.html" title="gtk.FileFilter"><code class="classname">gtk.FileFilter</code></a></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">set_filter</code>() method sets the
"filter" property to the value of <em class="parameter"><code>filter</code></em> and also
sets the current filter to <em class="parameter"><code>filter</code></em>. Only the files
that pass <em class="parameter"><code>filter</code></em> will be displayed. If the
user-selectable list of filters is non-empty, then
<em class="parameter"><code>filter</code></em> should be one of the filters in that
list. Setting the current filter when the list of filters is empty is useful
if you want to restrict the displayed set of files without letting the user
change it.</p></div><div class="refsect2" title="gtk.FileChooser.get_filter"><a name="method-gtkfilechooser--get-filter"></a><h3>gtk.FileChooser.get_filter</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_filter</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the current filter, or
<code class="literal">None</code>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">get_filter</code>() method returns the
value of the "filter" property which is the current filter. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-filter" title="gtk.FileChooser.set_filter"><code class="methodname">set_filter()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.add_shortcut_folder"><a name="method-gtkfilechooser--add-shortcut-folder"></a><h3>gtk.FileChooser.add_shortcut_folder</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_shortcut_folder</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>folder</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>folder</code></strong> :</span></p></td><td>the filename of the folder to
add</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the folder could be
added successfully.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">add_shortcut_folder</code>() adds the
folder specified by <em class="parameter"><code>folder</code></em> the list of shortcut
folders in a file chooser. Shortcut folders are displayed at the upper left
in the <a class="link" href="class-gtkfilechooser.html" title="gtk.FileChooser"><code class="classname">gtk.FileChooser</code></a>. By
double-clicking on a shortcut the user can open that folder directly. Note
that shortcut folders do not get saved, as they are provided by the
application. For example, you can use this to add a
"/usr/share/mydrawprogram/Clipart" folder to the volume list.</p><p>The GError exception is raised if an error occurred while adding
the folder.</p></div><div class="refsect2" title="gtk.FileChooser.remove_shortcut_folder"><a name="method-gtkfilechooser--remove-shortcut-folder"></a><h3>gtk.FileChooser.remove_shortcut_folder</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove_shortcut_folder</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>folder</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>folder</code></strong> :</span></p></td><td>the filename of the folder to
remove</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if
<em class="parameter"><code>folder</code></em> was removed from the list of
shortcut folders.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">remove_shortcut_folder</code>() method
removes the folder specified by <em class="parameter"><code>folder</code></em> from a file
chooser's list of shortcut
folders. <code class="methodname">remove_shortcut_folder</code>() returns True if
successful. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-shortcut-folder" title="gtk.FileChooser.add_shortcut_folder"><code class="methodname">add_shortcut_folder()</code></a>
method for more information.</p><p>The GError exception is raised if an error occurred while
removing the folder.</p></div><div class="refsect2" title="gtk.FileChooser.list_shortcut_folders"><a name="method-gtkfilechooser--list-shortcut-folders"></a><h3>gtk.FileChooser.list_shortcut_folders</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">list_shortcut_folders</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A list of shortcut folder filenames, or
<code class="literal">None</code> if there are no shortcut folders.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">list_shortcut_folders</code>() method
returns the list of shortcut folders in the file chooser, as set by the
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-shortcut-folder" title="gtk.FileChooser.add_shortcut_folder"><code class="methodname">add_shortcut_folder</code>()</a>
method or <code class="literal">None</code> if there are no shortcut folders. It is
not possible to get a list of the user-specified shortcut folders.</p></div><div class="refsect2" title="gtk.FileChooser.add_shortcut_folder_uri"><a name="method-gtkfilechooser--add-shortcut-folder-uri"></a><h3>gtk.FileChooser.add_shortcut_folder_uri</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">add_shortcut_folder_uri</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>uri</code></strong> :</span></p></td><td>the URI of the folder to add</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the folder was
added</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">add_shortcut_folder_uri</code>() method
adds a folder with the URI specified by <em class="parameter"><code>uri</code></em> to the
list of shortcut folders in a file chooser. Note that shortcut folders do
not get saved, as they are provided by the application. For example, you
can use this to add a "file:///usr/share/mydrawprogram/Clipart" folder to
the volume list. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-shortcut-folder" title="gtk.FileChooser.add_shortcut_folder"><code class="methodname">add_shortcut_folder</code>()</a>
method for more details.</p><p>The GError exception is raised if an error occurred while adding
the folder.</p></div><div class="refsect2" title="gtk.FileChooser.remove_shortcut_folder_uri"><a name="method-gtkfilechooser--remove-shortcut-folder-uri"></a><h3>gtk.FileChooser.remove_shortcut_folder_uri</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">remove_shortcut_folder_uri</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>uri</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>uri</code></strong> :</span></p></td><td>URI of the folder to remove</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the folder was
removed.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">remove_shortcut_folder_uri</code>() method
removes the folder with the URI specified by <em class="parameter"><code>uri</code></em> from
the file chooser's list of shortcut folders.</p><p>The GError exception is raised if an error occurred while
removing the folder.</p></div><div class="refsect2" title="gtk.FileChooser.list_shortcut_folder_uris"><a name="method-gtkfilechooser--list-shortcut-folder-uris"></a><h3>gtk.FileChooser.list_shortcut_folder_uris</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">list_shortcut_folder_uris</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list of shortcut folder URIs, or
<code class="literal">None</code></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.4 and above.</p></div><p>The <code class="methodname">list_shortcut_folder_uris</code>() method
returns a list of the shortcut folders in the file chooser, as set by the
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--add-shortcut-folder-uri" title="gtk.FileChooser.add_shortcut_folder_uri"><code class="methodname">add_shortcut_folder_uri</code>()</a>
method. It is not possible to get a list of the user-specified folder
URIs.</p></div><div class="refsect2" title="gtk.FileChooser.set_show_hidden"><a name="method-gtkfilechooser--set-show-hidden"></a><h3>gtk.FileChooser.set_show_hidden</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_show_hidden</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>show_hidden</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>show_hidden</code></strong> :</span></p></td><td>if <code class="literal">True</code> hidden files and
folders should be displayed.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="methodname">set_show_hidden</code>() method sets the
"show-hidden" property to the value of
<em class="parameter"><code>show_hidden</code></em>. If <em class="parameter"><code>show_hidden</code></em> is
<code class="literal">True</code>, hidden files and folders should be displayed in the
file selector.</p></div><div class="refsect2" title="gtk.FileChooser.get_show_hidden"><a name="method-gtkfilechooser--get-show-hidden"></a><h3>gtk.FileChooser.get_show_hidden</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_show_hidden</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if hidden files and
folders are displayed.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <code class="methodname">get_show_hidden</code>() method returns
the value of the "show-hidden" property that indicates whether hidden files
and folders should be displayed in the file selector. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-show-hidden" title="gtk.FileChooser.set_show_hidden"><code class="methodname">set_show_hidden()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.set_do_overwrite_confirmation"><a name="method-gtkfilechooser--set-do-overwrite-confirmation"></a><h3>gtk.FileChooser.set_do_overwrite_confirmation</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_do_overwrite_confirmation</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>do_overwrite_confirmation</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>do_overwrite_confirmation</code></strong> :</span></p></td><td>if <code class="literal">True</code> ask the user for
confirmation before overwriting a file in save mode.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">set_do_overwrite_confirmation</code>()
method sets the "do-overwrite-confirmation" property to the value of
<em class="parameter"><code>do_overwrite_confirmation</code></em>. If
<em class="parameter"><code>do_overwrite_confirmation</code></em> is <code class="literal">True</code>
and the "action" property is set to
<code class="literal">gtk.FILE_CHOOSER_ACTION_SAVE</code>, the file chooser will
present a confirmation dialog if the user attempts to overwrite an existing
file. The default value is <code class="literal">False</code>.</p><p>If all you need is the stock confirmation dialog, set the
"do-overwrite-confirmation" property to <code class="literal">True</code>. You can
override the way confirmation is done by actually handling the
"confirm-overwrite" signal; please refer to its documentation for
details.</p></div><div class="refsect2" title="gtk.FileChooser.get_do_overwrite_confirmation"><a name="method-gtkfilechooser--get-do-overwrite-confirmation"></a><h3>gtk.FileChooser.get_do_overwrite_confirmation</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_do_overwrite_confirmation</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if hidden files and
folders are displayed.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.8 and above.</p></div><p>The <code class="methodname">get_do_overwrite_confirmation</code>()
method returns the value of the "do-overwrite-confirmation" property that
indicates whether a user is asked for confirmation before overwriting an
existing file. See the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-do-overwrite-confirmation" title="gtk.FileChooser.set_do_overwrite_confirmation"><code class="methodname">set_do_overwrite_confirmation()</code></a>
method for more information.</p></div><div class="refsect2" title="gtk.FileChooser.get_current_folder_file"><a name="method-gtkfilechooser--get-current-folder-file"></a><h3>gtk.FileChooser.get_current_folder_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_current_folder_file</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The <PYGTKDOCLINK HREF="class-giofile">
<code class="classname">gio.File</code></PYGTKDOCLINK>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.14 and above.</p></div><p>
The <code class="methodname">get_current_folder_file</code>() method returns
the current folder of chooser as <PYGTKDOCLINK HREF="class-giofile"><code class="classname">gio.File</code></PYGTKDOCLINK>.
See <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-current-folder-uri" title="gtk.FileChooser.get_current_folder_uri">gtk.FileChooser.get_current_folder_uri</a>().
</p></div><div class="refsect2" title="gtk.FileChooser.get_file"><a name="method-gtkfilechooser--get-file"></a><h3>gtk.FileChooser.get_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_file</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>A selected <PYGTKDOCLINK HREF="class-giofile">
<code class="classname">gio.File</code></PYGTKDOCLINK>.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.14 and above.</p></div><p>
The <code class="methodname">get_file</code>() method returns
the <PYGTKDOCLINK HREF="class-giofile"><code class="classname">gio.File</code></PYGTKDOCLINK>
for the currently selected file in the file selector.
If multiple files are selected, one of the files will be returned at random.
</p><p>
If the file chooser is in folder mode, this function returns the selected folder.
</p></div><div class="refsect2" title="gtk.FileChooser.get_preview_file"><a name="method-gtkfilechooser--get-preview-file"></a><h3>gtk.FileChooser.get_preview_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_preview_file</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>The <PYGTKDOCLINK HREF="class-giofile">
<code class="classname">gio.File</code></PYGTKDOCLINK> for the file to preview,
or <code class="literal">None</code> if no file is selected.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.14 and above.</p></div><p>
The <code class="methodname">get_preview_file</code>() method returns
the <PYGTKDOCLINK HREF="class-giofile"><code class="classname">gio.File</code></PYGTKDOCLINK>
that should be previewed in a custom preview Internal function, see
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-uri" title="gtk.FileChooser.get_preview_uri">gtk.FileChooser.get_preview_uri</a>().
</p></div><div class="refsect2" title="gtk.FileChooser.select_file"><a name="method-gtkfilechooser--select-file"></a><h3>gtk.FileChooser.select_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">select_file</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>file</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>file</code></strong> :</span></p></td><td>the file to select.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if both the folder could be changed
and the path was selected successfully,
<code class="literal">False</code> otherwise. </td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.14 and above.</p></div><p>
The <code class="methodname">select_file</code>() method
selects the file referred to by file. An internal function. See
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--select-uri" title="gtk.FileChooser.select_uri">gtk.FileChooser.select_uri</a>().
</p></div><div class="refsect2" title="gtk.FileChooser.set_current_folder_file"><a name="method-gtkfilechooser--set-current-folder-file"></a><h3>gtk.FileChooser.set_current_folder_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_current_folder_file</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>file</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>file</code></strong> :</span></p></td><td>the <PYGTKDOCLINK HREF="class-giofile"><code class="classname">gio.File</code></PYGTKDOCLINK>
for the new folder.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the folder could be changed
successfully, <code class="literal">False</code> otherwise.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.14 and above.</p></div><p>
The <code class="methodname">set_current_folder_file</code>() method
sets the current folder for chooser from a
<PYGTKDOCLINK HREF="class-giofile"><code class="classname">gio.File</code></PYGTKDOCLINK>.
Internal function, see
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-current-folder-uri" title="gtk.FileChooser.set_current_folder_uri">gtk.FileChooser.set_current_folder_uri</a>().
</p></div><div class="refsect2" title="gtk.FileChooser.set_file"><a name="method-gtkfilechooser--set-file"></a><h3>gtk.FileChooser.set_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_file</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>file</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>file</code></strong> :</span></p></td><td>the <PYGTKDOCLINK HREF="class-giofile"><code class="classname">gio.File</code></PYGTKDOCLINK>
to set as current.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if both the folder could be changed
and the file selected successfully, <code class="literal">False</code> otherwise.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.14 and above.</p></div><p>
The <code class="methodname">set_file</code>() method
Sets file as the current filename for the file chooser, by changing to the
file's parent folder and actually selecting the file in list.
If the chooser is in gtk.FILE_CHOOSER_ACTION_SAVE mode, the file's base
name will also appear in the dialog's file name entry.
</p><p>
If the file name isn't in the current folder of chooser, then the current
folder of chooser will be changed to the folder containing filename.
This is equivalent to a sequence of
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--unselect-all" title="gtk.FileChooser.unselect_all">gtk.FileChooser.unselect_all</a>()
followed by <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--select-filename" title="gtk.FileChooser.select_filename">gtk.FileChooser.select_filename</a>().
</p><p>
Note that the file must exist, or nothing will be done except for the directory change.
</p><p>
If you are implementing a File/Save As... dialog, you should use this function
if you already have a file name to which the user may save; for example,
when the user opens an existing file and then does File/Save As... on it.
If you don't have a file name already — for example, if the user just created a
new file and is saving it for the first time, do not call this function. Instead,
use something similar to this:
</p><pre class="programlisting">
if (document_is_new):
# the user just created a new document
chooser.set_current_folder_file(default_file_for_saving)
chooser.set_current_name("Untitled document")
else:
# the user edited an existing document
chooser.set_file(existing_file)
</pre></div><div class="refsect2" title="gtk.FileChooser.unselect_file"><a name="method-gtkfilechooser--unselect-file"></a><h3>gtk.FileChooser.unselect_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">unselect_file</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>file</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>file</code></strong> :</span></p></td><td>a <PYGTKDOCLINK HREF="class-giofile"><code class="classname">gio.File</code></PYGTKDOCLINK>.
</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.14 and above.</p></div><p>
The <code class="methodname">unselect_file</code>() method
unselects the file referred to by file. If the file is not in the current
directory, does not exist, or is otherwise not currently selected, does nothing.
</p></div></div><div class="refsect1" title="Signals"><a name="id3706919"></a><h2>Signals</h2><div class="refsect2" title='The "confirm-overwrite" gtk.FileChooser Signal'><a name="signal-gtkfilechooser--confirm-overwrite"></a><h3>The "confirm-overwrite" gtk.FileChooser Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filechooser</code></em> :</span></p></td><td>the filechooser widget that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> one of the <a class="xref" href="gtk-constants.html#gtk-filechooser-confirmation-constants" title="GTK FileChooser Confirmation Constants">GTK FileChooser Confirmation Constants</a>
indicating what action GTK+ should take.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in PyGTK 2.8 and above.</p></div><p>The "confirm-overwrite" signal is emitted when it is appropriate
to present a confirmation dialog when the user has selected a file name that
already exists. The signal is only emitted when the file chooser "action" property is set to <code class="literal">gtk.FILE_CHOOSER_ACTION_SAVE</code>.</p><p> Most applications just need to turn on the
"do-overwrite-confirmation" property (or call the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-do-overwrite-confirmation" title="gtk.FileChooser.set_do_overwrite_confirmation"><code class="methodname">set_do_overwrite_confirmation</code>()</a>
method), to automatically get a stock confirmation dialog. Applications
that need to customize this behavior should do that, and also connect to
the "confirm-overwrite" signal.</p><p>A signal handler for this signal must return one of the <a class="xref" href="gtk-constants.html#gtk-filechooser-confirmation-constants" title="GTK FileChooser Confirmation Constants">GTK FileChooser Confirmation Constants</a> that
indicates the action to take. If the handler determines that the user wants
to select a different filename, it should return
<code class="literal">gtk.FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</code>. If it
determines that the user is satisfied with his choice of file name, it
should return
<code class="literal">gtk.FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</code>. On the
other hand, if it determines that the stock confirmation dialog should be
used, it should return
<code class="literal">gtkfile_CHOOSER_CONFIRMATION_CONFIRM</code>. The following
psuedo-code example illustrates this.</p><pre class="programlisting">
def confirm_overwrite_callback(chooser):
uri = chooser.get_uri()
if is_uri_read_only(uri):
if user_wants_to_replace_read_only_file (uri):
return gtk.FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME
else
return gtk.FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN
else
# fall back to the default dialog
return gtk.FILE_CHOOSER_CONFIRMATION_CONFIRM
...
chooser = gtk.FileChooserDialog(...)
chooser.set_do_overwrite_confirmation(True)
chooser.connect("confirm-overwrite", confirm_overwrite_callback)
if chooser.run() == gtk.RESPONSE_ACCEPT:
save_to_file(chooser.get_filename()
chooser.destroy()
</pre></div><div class="refsect2" title='The "current-folder-changed" gtk.FileChooser Signal'><a name="signal-gtkfilechooser--current-folder-changed"></a><h3>The "current-folder-changed" gtk.FileChooser Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filechooser</code></em> :</span></p></td><td>the filechooser widget that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in PyGTK 2.4 and above.</p></div><p>The "current-folder-changed" signal is emitted when the current
folder displayed in <em class="parameter"><code>filechooser</code></em> is changed. Normally
you do not need to connect to this signal, unless you need to keep track of
which folder a file chooser is showing.</p></div><div class="refsect2" title='The "file-activated" gtk.FileChooser Signal'><a name="signal-gtkfilechooser--file-activated"></a><h3>The "file-activated" gtk.FileChooser Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filechooser</code></em> :</span></p></td><td>the filechooser widget that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in PyGTK 2.4 and above.</p></div><p>The "file-activated" signal is emitted when the user
double-clicks on a file (not a folder) or presses
<span class="keycap"><strong>Enter</strong></span>. Normally you do not need to connect to this
signal. It is used internally by <a class="link" href="class-gtkfilechooserdialog.html" title="gtk.FileChooserDialog"><code class="classname">gtk.FileChooserDialog</code></a>
to know when to activate the default button in the dialog.</p></div><div class="refsect2" title='The "selection-changed" gtk.FileChooser Signal'><a name="signal-gtkfilechooser--selection-changed"></a><h3>The "selection-changed" gtk.FileChooser Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filechooser</code></em> :</span></p></td><td>the filechooser widget that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in PyGTK 2.4 and above.</p></div><p>The "selection-changed" signal is emitted when the file
selection in <em class="parameter"><code>filechooser</code></em> is changed either by
clicking on a filename or by changing the current folder. Normally you do
not need to connect to this signal, as it is easier to wait for the file
chooser to finish running, and then to get the list of selected files using
the functions mentioned below.</p></div><div class="refsect2" title='The "update-preview" gtk.FileChooser Signal'><a name="signal-gtkfilechooser--update-preview"></a><h3>The "update-preview" gtk.FileChooser Signal</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><em class="parameter"><code>filechooser</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>user_param1</code></em></span></span>, <span class="methodparam"><span class="parameter"><em class="parameter"><code>...</code></em></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filechooser</code></em> :</span></p></td><td>the filechooser widget that received the
signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_param1</code></em> :</span></p></td><td>the first user parameter (if any) specified
with the <PYGTKDOCLINK HREF="method-gobject--connect"><code class="methodname">connect</code>()</PYGTKDOCLINK>
method</td></tr><tr><td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in PyGTK 2.4 and above.</p></div><p>The "update-preview" signal is emitted when the preview when a
file chooser should be regenerated. For example, this can happen when the
currently selected file changes. You should use this signal if you want your
file chooser to have a preview widget.</p><p>Once you have installed a preview widget with the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget</code>()</a>
method, you should update it when this signal is emitted. You can use the
methods <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-filename" title="gtk.FileChooser.get_preview_filename"><code class="methodname">get_preview_filename</code>()</a>
or <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-uri" title="gtk.FileChooser.get_preview_uri"><code class="methodname">get_preview_uri</code>()</a>
to get the name of the file to preview. Your widget may not be able to
preview all kinds of files so your callback must call the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget-active" title="gtk.FileChooser.set_preview_widget_active"><code class="methodname">set_preview_widget_active</code>()</a>
to inform the file chooser if the preview was generated successfully or
not.</p><p>Please see the example code in the section called <a class="link" href="class-gtkfilechooser.html#AddingAPreviewWidget" title="Adding A Preview Widget">Adding a Preview Widget</a>.</p><p>Also see the <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget" title="gtk.FileChooser.set_preview_widget"><code class="methodname">set_preview_widget</code>()</a>,
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-preview-widget-active" title="gtk.FileChooser.set_preview_widget_active"><code class="methodname">set_preview_widget_active</code>()</a>,
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--set-use-preview-label" title="gtk.FileChooser.set_use_preview_label"><code class="methodname">set_use_preview_label</code>()</a>,
<a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-filename" title="gtk.FileChooser.get_preview_filename"><code class="methodname">get_preview_filename</code>()</a>
and <a class="link" href="class-gtkfilechooser.html#method-gtkfilechooser--get-preview-uri" title="gtk.FileChooser.get_preview_uri"><code class="methodname">get_preview_uri</code>()</a>
methods for more information</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkexpander.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gtkfilechooserbutton.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Expander </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.FileChooserButton</td></tr></table></div></body></html>
|