cvs: php-gtk-doc /examples/reference/gtk/gtkalignment constructor.phpw /manual/en/reference/gtk gtkalignment.xml
| From: | Christian Weiske | Date: | Thu, 03 Nov 2005 17:40:31 +0000 |
| Subject: | cvs: php-gtk-doc /examples/reference/gtk/gtkalignment constructor.phpw /manual/en/reference/gtk gtkalignment.xml | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1613@lists.php.net to get a copy of this message | ||
cweiske Thu Nov 3 12:40:31 2005 EDT
Modified files:
/php-gtk-doc/examples/reference/gtk/gtkalignment constructor.phpw
/php-gtk-doc/manual/en/reference/gtk gtkalignment.xml
Log:
Jp's gtkalignment docs v2
http://cvs.php.net/diff.php/php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw?r1=1.1&r2=1.2&ty=u
Index: php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw
diff -u php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw:1.1
php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw:1.2
--- php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw:1.1 Thu Nov 3 02:22:19 2005
+++ php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw Thu Nov 3 12:40:27 2005
@@ -7,7 +7,7 @@
//A GtkVBox that will hold the GtkAlignment widgets and GtkHSeparators
$vbox = new GtkVBox();
-//Let's create three GtkAlignment containers with different settings, each holding a button
+//Let's create four GtkAlignment containers with different settings, each holding a button
//First GtkAlignment container.
@@ -15,9 +15,9 @@
//Positioning the button at the top-left of the window, not allowing it to extend:
$align1 = new GtkAlignment(0, 0, 0, 0);
//Let's push the button down and right, with padding on the top and left:
-$align1->set_padding(200, 0, 200, 0);
+$align1->set_padding(100, 100, 100, 100);
//Creating a button.
-$button1 = new GtkButton('This GtkButton is here because of a padding_top and padding_left of
200 pixels.', false);
+$button1 = new GtkButton('Padding of 100 pixels', false);
//Adding button1 to the first GtkAlignment container
$align1->add($button1);
//Packing the GtkAlignment container into the GtkVBox
@@ -32,7 +32,7 @@
//This container will center it's child, while not allowing it to extend to occupy all free
space
$align2 = new GtkAlignment(0.5, 0.5, 0, 0);
//Creating a new button
-$button2 = new GtkButton('This GtkButton is centered using GtkAlignment');
+$button2 = new GtkButton('Centered, does not extend');
//Adding button2 to the second GtkAlignment container
$align2->add($button2);
//Packing the GtkAlignment container into the GtkVBox
@@ -44,15 +44,30 @@
//Third GtkAlignment container.
-//This container will center it's child, allowing it extend into 75% (0.75) of the free space
+//This container will center it's child, allowing it extend into 75% (0.75) of the *free
space* in the container
$align3 = new GtkAlignment(0.5, 0.5, 0.75, 0.75);
//Creating a new button
-$button3 = new GtkButton('This one is centered and extends to occupy 75% of the empty space.
Try resizing the window!');
+$button3 = new GtkButton("Centered, extends an extra \r\n75% of empty space");
//Adding button3 to the third GtkAlignment container
$align3->add($button3);
//Packing the GtkAlignment container into the GtkVBox
$vbox->pack_start($align3, true, true);
+//Adding a GtkHSeparator, to see the different GtkAlignment containers better
+$vbox->pack_start(new GtkHSeparator(), false, false, 3);
+
+
+//Fourth GtkAlignment container.
+
+//This container will right-align it's child, without extending it
+$align4 = new GtkAlignment(1, 0.5, 0, 0);
+//Creating a new button
+$button4 = new GtkButton("Right-aligned, doesn't extend");
+//Adding button4 to the fourth GtkAlignment container
+$align4->add($button4);
+//Packing the GtkAlignment container into the GtkVBox
+$vbox->pack_start($align4, true, true);
+
//Preparing the window
$win = new gtkwindow();
http://cvs.php.net/diff.php/php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml?r1=1.3&r2=1.4&ty=u
Index: php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml
diff -u php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml:1.3
php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml:1.4
--- php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml:1.3 Thu Nov 3 02:22:19 2005
+++ php-gtk-doc/manual/en/reference/gtk/gtkalignment.xml Thu Nov 3 12:40:30 2005
@@ -15,10 +15,18 @@
will never be scaled down to a size smaller than that of the label.
</para>
<para>
- It can be used to define the relative alignment of the child within the
- container
(<parameter>xalign</parameter>/<parameter>yalign</parameter>),
- and the relative ammount of free space assigned to the container that the
- child is allowed to extend
(<parameter>xscale</parameter>/<parameter>yscale</parameter>).
+ It can be used to define the relative alignment of the child
+ <emphasis>within</emphasis> the container, through the
+ <parameter>xalign</parameter> and <parameter>yalign</parameter>
parameters.
+ Both can vary between 0 and 1, meaning left/top and right/bottom, respectively.
+ This is very useful, for instance in left- or right-aligning
<classname>GtkLabel</classname>s.
+ </para>
+ <para>
+ Another use for <classname>GtkAlignment</classname> (through
+ <parameter>xscale</parameter> and <parameter>yscale</parameter>), is to
+ indicate the ammount of extra free space in the container the child should
+ be extended to occupy. Note that this isn't the same as total size of the
+ child widget.
</para>
<para>
<classname>GtkAlignment</classname> also provides methods to specifically