cvs: php-gtk-doc /examples/reference/gtk/gtkbox packing.phpw /images/reference/gtk gtkbox.packing.png /manual/en/reference/gtk gtkbox.xml
| From: | Christian Weiske | Date: | Mon, 31 Oct 2005 11:40:20 +0000 |
| Subject: | cvs: php-gtk-doc /examples/reference/gtk/gtkbox packing.phpw /images/reference/gtk gtkbox.packing.png /manual/en/reference/gtk gtkbox.xml | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1594@lists.php.net to get a copy of this message | ||
cweiske Mon Oct 31 06:40:20 2005 EDT
Added files:
/php-gtk-doc/images/reference/gtk gtkbox.packing.png
/php-gtk-doc/examples/reference/gtk/gtkbox packing.phpw
Modified files:
/php-gtk-doc/manual/en/reference/gtk gtkbox.xml
Log:
Added an example and a screenshot to demonstrate
the "fill" and "expand" parameter of the pack_start/pack_end
methods
http://cvs.php.net/diff.php/php-gtk-doc/manual/en/reference/gtk/gtkbox.xml?r1=1.3&r2=1.4&ty=u
Index: php-gtk-doc/manual/en/reference/gtk/gtkbox.xml
diff -u php-gtk-doc/manual/en/reference/gtk/gtkbox.xml:1.3
php-gtk-doc/manual/en/reference/gtk/gtkbox.xml:1.4
--- php-gtk-doc/manual/en/reference/gtk/gtkbox.xml:1.3 Sat Sep 24 07:55:52 2005
+++ php-gtk-doc/manual/en/reference/gtk/gtkbox.xml Mon Oct 31 06:40:20 2005
@@ -94,7 +94,7 @@
<paramdef>GtkWidget <parameter>child</parameter></paramdef>
<paramdef>bool <parameter><optional>expand =
TRUE</optional></parameter></paramdef>
<paramdef>bool <parameter><optional>fill =
TRUE</optional></parameter></paramdef>
- <paramdef>int <parameter><optional>padding =
TRUE</optional></parameter></paramdef>
+ <paramdef>int <parameter><optional>padding =
0</optional></parameter></paramdef>
</funcprototype>
</funcsynopsis>
<shortdesc>
@@ -120,6 +120,38 @@
See also:
<function class="GtkBox">pack_end</function>
</simpara>
+
+ <example>
+ <title>GtkBox' expand and fill parameters in action</title>
+
+ <para>
+ This example demonstrates the <parameter>expand</parameter> and
+ <parameter>fill</parameter> parameters.
+ </para>
+ <para>
+ At first two <classname>GtkLabel</classname>s are created and
+ <function class="GtkBox">pack_start</function>'ed to a box,
+ the first expanded and the second unexpanded.
+ </para>
+ <para>
+ The right side of the window shows the <parameter>fill</parameter>
+ parameter: Two buttons are added to the box, both expanded, but only
+ the first one filled: The second one takes half of the space, but
+ keeps the ideal size required to display all the text, while
+ the first one takes all the space for display.
+ </para>
+
+
+ <graphic fileref="&directory.images;/reference/gtk/gtkbox.packing.png"/>
+
+ <programlisting role="php">
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="&directory.examples;/reference/gtk/gtkbox/packing.phpw"
parse="text">
+ <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
+ </xi:include>
+ </programlisting>
+ </example>
+
</desc>
</method>
http://cvs.php.net/co.php/php-gtk-doc/examples/reference/gtk/gtkbox/packing.phpw?r=1.1&p=1
Index: php-gtk-doc/examples/reference/gtk/gtkbox/packing.phpw
+++ php-gtk-doc/examples/reference/gtk/gtkbox/packing.phpw
<?php
//GtkBox expand and fill parameter example
/**
* Example 1: The "expand" parameter
*/
$boxExpand = new GtkVBox();
$lblExpand = new GtkLabel('Expand');
$lblNoExpand = new GtkLabel('No expand');
//Add the expanded Label with the
//expand parameter set to true
$boxExpand->pack_start($lblExpand, true);
//to see the difference better
$boxExpand->pack_start(new GtkHSeparator(), false, false, 3);
//Add the unexpanded label with the
//expand parameter set to false
$boxExpand->pack_start($lblNoExpand, false);
/**
* Example 2: The "fill" parameter
*/
$boxFill = new GtkVBox();
$btnFill = new GtkButton('Fill');
$btnNoFill = new GtkButton('No fill');
//Add the filled button to the box
//with the fill parameter set to true
$boxFill->pack_start($btnFill, true, true);
//to see the difference better
$boxFill->pack_start(new GtkHSeparator(), false, false, 3);
//Add the unfilled button to the box,
//with the filled parameter set to false
$boxFill->pack_start($btnNoFill, true, false);
/**
* Add both of the example boxes to the window
*/
$wnd = new GtkWindow();
$wnd->set_title('Pack test');
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$wnd->set_size_request(300, 200);
//Set the box homogenous, so that left and right
//example get the same space
$hbox = new GtkHBox(true);
//Add the expand example box
$hbox->pack_start($boxExpand, true);
//Add the fill example box
$hbox->pack_start($boxFill, true);
//Add the main box to the window
$wnd->add($hbox);
$wnd->show_all();
Gtk::main();
?>