Current File : //opt/RZphp73/includes/doc/Gtk2_FileDrop/examples/big_example.phpw
<?php
/**
*   Bigger test application for Gtk2_FileDrop class
*   Uses different MIME Types and file extensions
*   as well as callbacks with objects
*
*   @author Christian Weiske <cweiske@php.net>
*/
require_once('Gtk2/FileDrop.php');

class Test 
{
    var $te = 'asd';
    function Test() {
        $this->te = time();
    }
    function trie($widget, $arFiles)
    {
        echo $this->te . ' test';
        var_dump(get_class($widget), $arFiles);
    }
}

$window = new GtkWindow();
$window->set_default_size(300, 300);
$window->connect_simple('destroy', array('gtk', 'main_quit'));
$window->show();

$table = new GtkTable();
$window->add($table);
$arTypes = array(
    array('inode/directory'),
    array('.txt', '.htm', '.html'),
    array('image/*'),
    array('image/png'),
    array('.scott')
);

$nCount = 0;
foreach ($arTypes as $arTypeList) {
    $label = new GtkLabel(implode( ';', $arTypeList));
    $table->attach($label, 0, 1, $nCount, $nCount + 1, Gtk::FILL, Gtk::FILL);

    $entry = new GtkButton('drop on me');
    $table->attach($entry, 1, 2, $nCount, $nCount + 1, Gtk::EXPAND | Gtk::FILL, Gtk::FILL);

    Gtk2_FileDrop::attach($entry, $arTypeList);

    $nCount++;
}

$list = new GtkList();
$table->attach($list, 0, 3, $nCount, $nCount + 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL);
Gtk2_FileDrop::attach($list, array( 'text/*'));
$nCount++;

$fs = new GtkFileSelection('select a php file');
Gtk2_FileDrop::attach($fs, array( 'text/php', '.php', 'inode/directory'));
$fs->show();

$cmb = new GtkCombo();
$table->attach($cmb, 0, 3, $nCount, $nCount + 1, Gtk::FILL, Gtk::FILL);
$test = new Test();
Gtk2_FileDrop::attach($cmb, array( 'text/plain'), array($test, 'trie'), false);

$test->te = 'asd';
$window->show_all();
Gtk::main();
?>