#50525 [NEW]: FileSelection Complete Failure

[email protected] ("chezmmd at gmail dot com") Fri, 18 Dec 2009 19:58:33 GMT
Newsgroups php.gtk.dev
Message-ID <[email protected]>
From:             chezmmd at gmail dot com
Operating system: WinXP
PHP version:      5.2.12
PHP Bug Type:     PHP-GTK related
Bug description:  FileSelection Complete Failure

Description:
------------
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:
---------------
<?php
//Creating and initialising the file selection prompt
$filePrompt = new GtkFileSelection('GtkFileSelection Demo');
$filePrompt->connect_simple(
    'destroy',
    array('Gtk', 'main_quit')
);

$filePrompt->complete("*.txt");

 
//Adding a quit button that destroys the prompt
$filePrompt->cancel_button->set_label('Quit');
$filePrompt->cancel_button->connect_simple(
    'clicked',
    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(
        null,
        0,
        Gtk::MESSAGE_INFO,
        Gtk::BUTTONS_OK,
        'You selected: ' . $fileName
    );
    $message->run();
    $message->destroy();
}
 
//Show the prompt and start the main loop
$filePrompt->show();
Gtk::main();
?>

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

Actual result:
--------------
You get all files listed

-- 
Edit bug report at http://bugs.php.net/?id=50525&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=50525&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=50525&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=50525&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=50525&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50525&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=50525&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=50525&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=50525&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=50525&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=50525&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=50525&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=50525&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=50525&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=50525&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50525&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50525&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=50525&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=50525&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=50525&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=50525&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=50525&r=mysqlcfg