cvs: php-gtk /test fileselection.php

From: Date: Tue, 20 Mar 2001 21:07:31 +0000
Subject: cvs: php-gtk /test fileselection.php
Groups: php.gtk 
Request: Send a blank email to php-gtk+get-1032@lists.php.net to get a copy of this message
andrei Tue Mar 20 13:07:31 2001 EDT Modified files: /php-gtk/test fileselection.php Log: Showing how to get the filename. Index: php-gtk/test/fileselection.php diff -u php-gtk/test/fileselection.php:1.2 php-gtk/test/fileselection.php:1.3 --- php-gtk/test/fileselection.php:1.2 Wed Mar 7 19:02:27 2001 +++ php-gtk/test/fileselection.php Tue Mar 20 13:07:31 2001 @@ -1,6 +1,6 @@ <?php -/* $Id: fileselection.php,v 1.2 2001/03/08 03:02:27 andrei Exp $ */ +/* $Id: fileselection.php,v 1.3 2001/03/20 21:07:31 andrei Exp $ */ if (!class_exists('gtk')) { if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')) @@ -10,12 +10,14 @@ } function shutdown() { - print("Shutting down.\n"); + print "Shutting down.\n" ; Gtk::main_quit(); } -function EndDialog() { - print("OK button clicked\n"); +function EndDialog($button, $fs) { + print "OK button clicked, "; + print $fs->get_filename(); + print " selected.\n"; return true; } @@ -27,7 +29,7 @@ function FileDialog() { $fs = &new GtkFileSelection('File Selection Example'); $ok_button = $fs->ok_button; - $ok_button->connect('clicked', 'enddialog'); + $ok_button->connect('clicked', 'enddialog', $fs); $ok_button->connect_object('clicked', array($fs, 'destroy')); $cancel_button = $fs->cancel_button; $cancel_button->connect('clicked', 'canceldialog');

« previous php.gtk (#1032) next »