|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50525 FileSelection Complete Failure
Submitted: 2009-12-18 19:58 UTC Modified: 2009-12-26 01:00 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: chezmmd at gmail dot com Assigned:
Status: No Feedback Package: PHP-GTK related
PHP Version: 5.2.12 OS: WinXP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-12-18 19:58 UTC] chezmmd at gmail dot com
Cannot get GtkFileSelection->complete to work, using current release.

Took online Manual example of object construction, and added a complete stmt.  Results invalid.

Reproduce code:
//Creating and initialising the file selection prompt
$filePrompt = new GtkFileSelection('GtkFileSelection Demo');
    array('Gtk', 'main_quit')


//Adding a quit button that destroys the prompt
    array($filePrompt, 'destroy')
//Add an OK button that displays the file selected on click
$filePrompt->ok_button->set_label('Show the file');
$filePrompt->ok_button->connect('clicked', 'showFile');
//Callback function that displays the file name
function showFile($okbutton)
    $filePrompt = $okbutton->get_toplevel();
    $fileName = $filePrompt->get_filename();
    $message = new GtkMessageDialog(
        'You selected: ' . $fileName
//Show the prompt and start the main loop

Expected result:
You should see only txt extension files in results window.  

Actual result:
You get all files listed


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-18 20:06 UTC]
This is a problem in the gtk libraries themselves, not in the PHP wrapper.  PHP just calls the underlying C method

GtkFileSelection is deprecated as well

Try using GtkFileChooserDialog with  the set_filter method instead
 [2009-12-18 20:15 UTC] chezmmd at gmail dot com
GtkFileSelection isn't marked as deprecated...???
 [2009-12-18 20:37 UTC]
GtkFileSelection has been deprecated since Gtk 2.12, so the 2.0.1 release of PHP-GTK does not yet mark it deprecated.

However the example code for me is working perfectly.

Run your script and then in the selection box hit the tab key

Notice how only files/folders that match *.txt are now shown?

You can probably simulate the keypress in your code to make the filter action transparent to the user.

 [2009-12-26 01:00 UTC] php-gtk-dev at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 09 11:03:34 2021 UTC