svn: /gtk/php-gtk-doc/trunk/ examples/reference/gtk/gtkfilechooserdialog/construct.php manual/en/reference/gtk/gtkfilechooserdialog.xml

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn: /gtk/php-gtk-doc/trunk/ examples/reference/gtk/gtkfilechooserdialog/construct.php manual/en/reference/gtk/gtkfilechooserdialog.xml

markskilbeck
markskilbeck                             Mon, 18 Oct 2010 20:41:45 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=304490

Log:
Adding example for GtkFileChooserDialog

Changed paths:
    A   gtk/php-gtk-doc/trunk/examples/reference/gtk/gtkfilechooserdialog/
    A   gtk/php-gtk-doc/trunk/examples/reference/gtk/gtkfilechooserdialog/construct.php
    U   gtk/php-gtk-doc/trunk/manual/en/reference/gtk/gtkfilechooserdialog.xml

Added: gtk/php-gtk-doc/trunk/examples/reference/gtk/gtkfilechooserdialog/construct.php
===================================================================
--- gtk/php-gtk-doc/trunk/examples/reference/gtk/gtkfilechooserdialog/construct.php                        (rev 0)
+++ gtk/php-gtk-doc/trunk/examples/reference/gtk/gtkfilechooserdialog/construct.php 2010-10-18 20:41:45 UTC (rev 304490)
@@ -0,0 +1,26 @@
+<?php
+
+function responseCallback($dialog, $response)
+{
+ switch ($response)
+ {
+ case Gtk::RESPONSE_OK:
+ echo "You chose file path ", $dialog->get_filename();
+ break;
+ case Gtk::RESPONSE_CANCEL:
+ echo "You selected cancel";
+ }
+ $dialog->destroy();
+}
+
+$dialog = new GtkFileChooserDialog(
+ 'Pick a file...',                # Dialog title
+ NULL,                           # Parent
+ Gtk::FILE_CHOOSER_ACTION_OPEN,   # File chooser action (open a file)
+ array (                          # Button title, button response, ...
+ 'Open', Gtk::RESPONSE_OK,
+ 'Cancel', Gtk::RESPONSE_CANCEL
+ )
+);
+$dialog->connect('response', 'responseCallback');
+$response = $dialog->run();
\ No newline at end of file

Modified: gtk/php-gtk-doc/trunk/manual/en/reference/gtk/gtkfilechooserdialog.xml
===================================================================
--- gtk/php-gtk-doc/trunk/manual/en/reference/gtk/gtkfilechooserdialog.xml 2010-10-18 19:16:06 UTC (rev 304489)
+++ gtk/php-gtk-doc/trunk/manual/en/reference/gtk/gtkfilechooserdialog.xml 2010-10-18 20:41:45 UTC (rev 304490)
@@ -70,8 +70,15 @@
      Creates a GtkFileChooserDialog window to be used for functionality such as
      opening and saving files.
     </para>
+    <example>
+     <title>An reconstruction of the GtkMessageDialog using GtkDialog.</title>
+     <programlisting role="php">
+       <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="&directory.examples;/reference/gtk/gtkfilechooserdialog/constructor.php" parse="text">
+       <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
+      </xi:include>
+     </programlisting>
+    </example>
    </desc>
-   <!-- FIXME: Needs an example -->
   </constructor>
  </constructors>



--
PHP-GTK Documentation Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php