cvs: peardoc / manual.xml.in /en/package gtk2.xml /en/package/gtk2 filedrop.xml vardump.xml /en/package/gtk2/filedrop example.xml intro.xml
widgetsupport.xml
| From: | Christian Weiske | Date: | Thu, 16 Feb 2006 12:00:12 +0000 |
| Subject: | cvs: peardoc / manual.xml.in /en/package gtk2.xml /en/package/gtk2 filedrop.xml vardump.xml /en/package/gtk2/filedrop example.xml intro.xml widgetsupport.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7525@lists.php.net to get a copy of this message | ||
cweiske Thu Feb 16 12:00:12 2006 UTC
Added files:
/peardoc/en/package gtk2.xml
/peardoc/en/package/gtk2 vardump.xml filedrop.xml
/peardoc/en/package/gtk2/filedrop example.xml intro.xml
widgetsupport.xml
Modified files:
/peardoc manual.xml.in
Log:
- Added Gtk2 section
- Ported Gtk_FileDrop docs to Gtk2_FileDrop docs
- Added little Gtk2_VarDump doc page
http://cvs.php.net/viewcvs.cgi/peardoc/manual.xml.in?r1=1.41&r2=1.42&diff_format=u Index: peardoc/manual.xml.in diff -u peardoc/manual.xml.in:1.41 peardoc/manual.xml.in:1.42 --- peardoc/manual.xml.in:1.41 Fri Oct 14 14:53:03 2005 +++ peardoc/manual.xml.in Thu Feb 16 12:00:11 2006 @@ -93,6 +93,7 @@ &package.fileformats; &package.filesystem; &package.gtk; + &package.gtk2; &package.html; &package.http; &package.images; http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2.xml +++ peardoc/en/package/gtk2.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <chapter id="package.gtk2"> <title>Gtk2</title> <para> Provides useful packages for the <ulink url="http://gtk.php.net">PHP-Gtk2</ulink> extension. </para> <sect1> <title /> <simpara /> </sect1> &package.gtk2.filedrop; &package.gtk2.vardump; </chapter> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/vardump.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/vardump.xml +++ peardoc/en/package/gtk2/vardump.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="package.gtk2.vardump"> <title>Gtk2_VarDump</title> <para> <classname>Gtk2_VarDump</classname> is a simple GUI to examine php variables, for example complex arrays or objects. It displays the variable and all sub-variables/array keys/sub-objects in the left pane (a GtkTreeView), and the actual values in a list view on the right side. </para> <para> The class is very easy to use: Just include the file, and call the constructor with the variable you want to have dumped. </para> <example> <title>Showing a variable with Gtk2_VarDump</title> <programlisting role="php"><![CDATA[<?php //include the file require_once 'Gtk2/VarDump.php'; $myvar = array( 'hello', 2 => 'world', array(1, 2, 3, 'blubb') ); //graphically dump the variable in an own window new Gtk2_VarDump($myvar, 'variable title'); ?>]]></programlisting> </example> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/filedrop.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/filedrop.xml +++ peardoc/en/package/gtk2/filedrop.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="package.gtk2.filedrop"> <title>Gtk2_FileDrop</title> <para> Setting up GtkWidgets to accept files via Drag'n'Drop in a very easy way. </para> &package.gtk2.filedrop.intro; &package.gtk2.filedrop.widgetsupport; &package.gtk2.filedrop.example; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/filedrop/example.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/filedrop/example.xml +++ peardoc/en/package/gtk2/filedrop/example.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.gtk2.filedrop.example"> <refnamediv> <refname>Example</refname> <refpurpose> How to use Gtk2_FileDrop </refpurpose> </refnamediv> <refsect1> <title>Using Gtk2_FileDrop</title> <example> <title>General setup</title> <programlisting role="php"><![CDATA[<?php $accepted_types = array( 'text/html', 'text/plain', '.dat' ); Gtk_FileDrop::attach($widget, $accepted_types); ?>]]></programlisting> <para> Here we set up the array of accepted file types: The widget shall accept files with MIME-Type <literal>text/html</literal>, <literal>text/plain</literal> and files ending with <literal>.dat</literal>. After this we set up the <literal>$widget</literal> to accept this files. </para> </example> <example> <title>Accepting directories</title> <programlisting role="php"><![CDATA[$accepted_types = array( 'inode/directory', );]]></programlisting> <simpara> The MIME type <literal>inode/directory</literal> has to be used if the widget shall accept directories. </simpara> </example> <note> <simpara> When a file is dropped over a widget which accepts directories only, the directory of the filename is used. </simpara> </note> <example> <title>Setup with callback</title> <programlisting role="php"><![CDATA[<?php function filesDropped($widget, $arFiles) { foreach($arFiles as $strFile) { echo "The file \"$strFile\" has been dropped\r\n"; } } $accepted_types = array( 'text/html', 'text/plain', '.dat' ); Gtk_FileDrop::attach($widget, $accepted_types, 'filesDropped', false); ?>]]></programlisting> <para> In this example we use a callback function to print out all dropped files to the console. Further we determine the fourth parameter as <literal>false</literal> which means that the widget's value is not changed automatically. </para> <para> To use the callback with objects, you pass an array with the reference of the object: <example> <title>Using a callback</title> <programlisting role="php"><![CDATA[<?php Gtk_FileDrop::attach($widget, $accepted_types, array( &$this, 'filesDropped')); ?>]]></programlisting> </example> </para> </example> <example> <title>Working example</title> <programlisting role="php"><![CDATA[<?php require_once 'Gtk2/FileDrop.php'; $window = new GtkWindow(); $window->set_default_size(300, 30); $window->connect_simple('destroy', array('gtk', 'main_quit')); $window->show(); $entry = new GtkEntry(); $window->add($entry); $entry->set_text('drop text files on me'); Gtk_FileDrop::attach($entry, array('text/plain')); $window->show_all(); Gtk::main(); ?>]]></programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/filedrop/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/filedrop/intro.xml +++ peardoc/en/package/gtk2/filedrop/intro.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.gtk2.filedrop.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose> Why using Gtk2_FileDrop? </refpurpose> </refnamediv> <refsect1 id="packages.gtk2.filedrop.intro.contrib"> <title>Contributors</title> <para> <itemizedlist> <listitem><simpara>Christian Weiske</simpara></listitem> </itemizedlist> </para> </refsect1> <refsect1 id="packages.gtk2.filedrop.intro.desc"> <title>Description</title> <para> <classname>Gtk2_FileDrop</classname> provides an easy interface to set up GtkWidgets to receive files via Drag'n'Drop. Widgets can be told to accept a number of MIME-Types as well as a number of file extensions. Values of widgets can automatically be set when drops with valid files occur, or a callback function can be specified which is invoked in this case. </para> <para> Now one may think that the whole setup process is really simple and would not need a class like this to make widgets accept files. That is right. The setup for making widgets accept drops is an ease - but there are two more steps to do: <orderedlist> <listitem><simpara>Make the widget accept only some types of files</simpara></listitem> <listitem><simpara>Convert the dropped filenames to usable filenames</simpara></listitem> </orderedlist> </para> <para> The first item is not so hard to implement; we do this by either checking the file extension, or using the MIME_Type package to get the mime type. (Note: <literal>*</literal> is supported). </para> <para> The second item is the main problem as all applications seem to ignore the standard for file name exchange and cook their own soup (so using their own format) when passing the file names. This package knows the differences and converts the dropped strings into usable local filenames, regardless of the format the source application uses. For a deeper insight in this topic you should read the <ulink url="http://gtk.php.net/manual/en/tutorials.filednd.urilist.php" >PHP-Gtk FileDrop tutorial</ulink>. </para> <note> <simpara>A note about Mozilla/Firefox: Mozilla provides file names only with mime type <literal>text/plain</literal> only instead of <literal>text/uri-list</literal>. If we would accept this type as well, the problem arises that every text could be dropped - if it is a file or not. That's why the decision was made not to accept drops from Mozilla.</simpara> </note> <note> <simpara> <classname>Gtk2_FileDrop</classname> is the port of <classname>Gtk_FileDrop</classname> to PHP-Gtk2 and PHP5. Thus, it has identical methods and behaves the same. </simpara> </note> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/filedrop/widgetsupport.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/filedrop/widgetsupport.xml +++ peardoc/en/package/gtk2/filedrop/widgetsupport.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.gtk2.filedrop.widgetsupport"> <refnamediv> <refname>Widget support</refname> <refpurpose> Drops handled on different widget types </refpurpose> </refnamediv> <refsect1> <title>Natively supported widgets</title> <simpara> By default, the dropped files are displayed in the widget, e.g. if you drop a file over a <literal>GtkEntry</literal>, the text value of the widget will be overwritten to the filename. </simpara> <simpara> As not all widgets have such simple values, Gtk2_FileDrop has built-in support for a number of widget classes and acts different on different types. </simpara> <table> <title>Widget support</title> <tgroup cols="2"> <thead> <row> <entry>Widget class</entry> <entry>Action taken</entry> </row> </thead> <tbody> <row> <entry>GtkEntry</entry> <entry>Entry value is replaced with first file</entry> </row> <row> <entry>GtkLabel</entry> <entry>Label text is replaced with first file</entry> </row> <row> <entry>GtkButton</entry> <entry>Label text is replaced with first file if the first and only child is a GtkLabel</entry> </row> <row> <entry>GtkToggleButton</entry> <entry>Label text is replaced with first file if the first and only child is a GtkLabel</entry> </row> <row> <entry>GtkRadioButton</entry> <entry>Label text is replaced with first file if the first and only child is a GtkLabel</entry> </row> <row> <entry>GtkCheckButton</entry> <entry>Label text is replaced with first file if the first and only child is a GtkLabel</entry> </row> <row> <entry>GtkCombo</entry> <entry>The entry text is replaced with the first file. The list is not affected.</entry> </row> <row> <entry>GtkFileSelection</entry> <entry>File name of the file dialog is set to the first dropped file. The directory is changed to the directory name of the file, and the file name (without directory) is set in the file name entry. </entry> </row> <row> <entry>GtkList</entry> <entry>Every accepted file is appended at the end of the list. </entry> </row> </tbody> </tgroup> </table> <para> Beside the automatic actions, you can specify a callback as the third parameter of the <literal>attach</literal> function which is called with the widget itself and an array of accepted files as parameters. </para> </refsect1> </refentry>
http://cvs.php.net/viewcvs.cgi/peardoc/manual.xml.in?r1=1.41&r2=1.42&diff_format=u Index: peardoc/manual.xml.in diff -u peardoc/manual.xml.in:1.41 peardoc/manual.xml.in:1.42 --- peardoc/manual.xml.in:1.41 Fri Oct 14 14:53:03 2005 +++ peardoc/manual.xml.in Thu Feb 16 12:00:11 2006 @@ -93,6 +93,7 @@ &package.fileformats; &package.filesystem; &package.gtk; + &package.gtk2; &package.html; &package.http; &package.images; http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2.xml +++ peardoc/en/package/gtk2.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <chapter id="package.gtk2"> <title>Gtk2</title> <para> Provides useful packages for the <ulink url="http://gtk.php.net">PHP-Gtk2</ulink> extension. </para> <sect1> <title /> <simpara /> </sect1> &package.gtk2.filedrop; &package.gtk2.vardump; </chapter> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/vardump.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/vardump.xml +++ peardoc/en/package/gtk2/vardump.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="package.gtk2.vardump"> <title>Gtk2_VarDump</title> <para> <classname>Gtk2_VarDump</classname> is a simple GUI to examine php variables, for example complex arrays or objects. It displays the variable and all sub-variables/array keys/sub-objects in the left pane (a GtkTreeView), and the actual values in a list view on the right side. </para> <para> The class is very easy to use: Just include the file, and call the constructor with the variable you want to have dumped. </para> <example> <title>Showing a variable with Gtk2_VarDump</title> <programlisting role="php"><![CDATA[<?php //include the file require_once 'Gtk2/VarDump.php'; $myvar = array( 'hello', 2 => 'world', array(1, 2, 3, 'blubb') ); //graphically dump the variable in an own window new Gtk2_VarDump($myvar, 'variable title'); ?>]]></programlisting> </example> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/filedrop.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/filedrop.xml +++ peardoc/en/package/gtk2/filedrop.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="package.gtk2.filedrop"> <title>Gtk2_FileDrop</title> <para> Setting up GtkWidgets to accept files via Drag'n'Drop in a very easy way. </para> &package.gtk2.filedrop.intro; &package.gtk2.filedrop.widgetsupport; &package.gtk2.filedrop.example; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/filedrop/example.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/filedrop/example.xml +++ peardoc/en/package/gtk2/filedrop/example.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.gtk2.filedrop.example"> <refnamediv> <refname>Example</refname> <refpurpose> How to use Gtk2_FileDrop </refpurpose> </refnamediv> <refsect1> <title>Using Gtk2_FileDrop</title> <example> <title>General setup</title> <programlisting role="php"><![CDATA[<?php $accepted_types = array( 'text/html', 'text/plain', '.dat' ); Gtk_FileDrop::attach($widget, $accepted_types); ?>]]></programlisting> <para> Here we set up the array of accepted file types: The widget shall accept files with MIME-Type <literal>text/html</literal>, <literal>text/plain</literal> and files ending with <literal>.dat</literal>. After this we set up the <literal>$widget</literal> to accept this files. </para> </example> <example> <title>Accepting directories</title> <programlisting role="php"><![CDATA[$accepted_types = array( 'inode/directory', );]]></programlisting> <simpara> The MIME type <literal>inode/directory</literal> has to be used if the widget shall accept directories. </simpara> </example> <note> <simpara> When a file is dropped over a widget which accepts directories only, the directory of the filename is used. </simpara> </note> <example> <title>Setup with callback</title> <programlisting role="php"><![CDATA[<?php function filesDropped($widget, $arFiles) { foreach($arFiles as $strFile) { echo "The file \"$strFile\" has been dropped\r\n"; } } $accepted_types = array( 'text/html', 'text/plain', '.dat' ); Gtk_FileDrop::attach($widget, $accepted_types, 'filesDropped', false); ?>]]></programlisting> <para> In this example we use a callback function to print out all dropped files to the console. Further we determine the fourth parameter as <literal>false</literal> which means that the widget's value is not changed automatically. </para> <para> To use the callback with objects, you pass an array with the reference of the object: <example> <title>Using a callback</title> <programlisting role="php"><![CDATA[<?php Gtk_FileDrop::attach($widget, $accepted_types, array( &$this, 'filesDropped')); ?>]]></programlisting> </example> </para> </example> <example> <title>Working example</title> <programlisting role="php"><![CDATA[<?php require_once 'Gtk2/FileDrop.php'; $window = new GtkWindow(); $window->set_default_size(300, 30); $window->connect_simple('destroy', array('gtk', 'main_quit')); $window->show(); $entry = new GtkEntry(); $window->add($entry); $entry->set_text('drop text files on me'); Gtk_FileDrop::attach($entry, array('text/plain')); $window->show_all(); Gtk::main(); ?>]]></programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/filedrop/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/filedrop/intro.xml +++ peardoc/en/package/gtk2/filedrop/intro.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.gtk2.filedrop.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose> Why using Gtk2_FileDrop? </refpurpose> </refnamediv> <refsect1 id="packages.gtk2.filedrop.intro.contrib"> <title>Contributors</title> <para> <itemizedlist> <listitem><simpara>Christian Weiske</simpara></listitem> </itemizedlist> </para> </refsect1> <refsect1 id="packages.gtk2.filedrop.intro.desc"> <title>Description</title> <para> <classname>Gtk2_FileDrop</classname> provides an easy interface to set up GtkWidgets to receive files via Drag'n'Drop. Widgets can be told to accept a number of MIME-Types as well as a number of file extensions. Values of widgets can automatically be set when drops with valid files occur, or a callback function can be specified which is invoked in this case. </para> <para> Now one may think that the whole setup process is really simple and would not need a class like this to make widgets accept files. That is right. The setup for making widgets accept drops is an ease - but there are two more steps to do: <orderedlist> <listitem><simpara>Make the widget accept only some types of files</simpara></listitem> <listitem><simpara>Convert the dropped filenames to usable filenames</simpara></listitem> </orderedlist> </para> <para> The first item is not so hard to implement; we do this by either checking the file extension, or using the MIME_Type package to get the mime type. (Note: <literal>*</literal> is supported). </para> <para> The second item is the main problem as all applications seem to ignore the standard for file name exchange and cook their own soup (so using their own format) when passing the file names. This package knows the differences and converts the dropped strings into usable local filenames, regardless of the format the source application uses. For a deeper insight in this topic you should read the <ulink url="http://gtk.php.net/manual/en/tutorials.filednd.urilist.php" >PHP-Gtk FileDrop tutorial</ulink>. </para> <note> <simpara>A note about Mozilla/Firefox: Mozilla provides file names only with mime type <literal>text/plain</literal> only instead of <literal>text/uri-list</literal>. If we would accept this type as well, the problem arises that every text could be dropped - if it is a file or not. That's why the decision was made not to accept drops from Mozilla.</simpara> </note> <note> <simpara> <classname>Gtk2_FileDrop</classname> is the port of <classname>Gtk_FileDrop</classname> to PHP-Gtk2 and PHP5. Thus, it has identical methods and behaves the same. </simpara> </note> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/gtk2/filedrop/widgetsupport.xml?view=markup&rev=1.1 Index: peardoc/en/package/gtk2/filedrop/widgetsupport.xml +++ peardoc/en/package/gtk2/filedrop/widgetsupport.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.gtk2.filedrop.widgetsupport"> <refnamediv> <refname>Widget support</refname> <refpurpose> Drops handled on different widget types </refpurpose> </refnamediv> <refsect1> <title>Natively supported widgets</title> <simpara> By default, the dropped files are displayed in the widget, e.g. if you drop a file over a <literal>GtkEntry</literal>, the text value of the widget will be overwritten to the filename. </simpara> <simpara> As not all widgets have such simple values, Gtk2_FileDrop has built-in support for a number of widget classes and acts different on different types. </simpara> <table> <title>Widget support</title> <tgroup cols="2"> <thead> <row> <entry>Widget class</entry> <entry>Action taken</entry> </row> </thead> <tbody> <row> <entry>GtkEntry</entry> <entry>Entry value is replaced with first file</entry> </row> <row> <entry>GtkLabel</entry> <entry>Label text is replaced with first file</entry> </row> <row> <entry>GtkButton</entry> <entry>Label text is replaced with first file if the first and only child is a GtkLabel</entry> </row> <row> <entry>GtkToggleButton</entry> <entry>Label text is replaced with first file if the first and only child is a GtkLabel</entry> </row> <row> <entry>GtkRadioButton</entry> <entry>Label text is replaced with first file if the first and only child is a GtkLabel</entry> </row> <row> <entry>GtkCheckButton</entry> <entry>Label text is replaced with first file if the first and only child is a GtkLabel</entry> </row> <row> <entry>GtkCombo</entry> <entry>The entry text is replaced with the first file. The list is not affected.</entry> </row> <row> <entry>GtkFileSelection</entry> <entry>File name of the file dialog is set to the first dropped file. The directory is changed to the directory name of the file, and the file name (without directory) is set in the file name entry. </entry> </row> <row> <entry>GtkList</entry> <entry>Every accepted file is appended at the end of the list. </entry> </row> </tbody> </tgroup> </table> <para> Beside the automatic actions, you can specify a callback as the third parameter of the <literal>attach</literal> function which is called with the widget itself and an array of accepted files as parameters. </para> </refsect1> </refentry>