Re: Left justify doesn't
| From: | James Cameron | Date: | Mon, 28 Apr 2003 00:06:43 +0000 |
| Subject: | Re: Left justify doesn't | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3306@lists.php.net to get a copy of this message | ||
Text justification and widget alignment are two different things.
They are often confused, because text justification doesn't seem
to work when you think it should.
The text justification properties;
- only affect how the text is laid out within the area that the widget
has allocated to it,
- are most obvious on multiple line labels,
- are ineffective on single line labels.
The widget alignment properties;
- affect how the area the widget has allocated to it is placed *within*
the container area available to it,
- are effective on single and multiple line labels.
The X Align property;
- default is 0.5, which centers the widget,
- 0.0 means left alignment, and;
- 1.0 means right alignment.
The Y Align property affects the vertical position in the same way.
Attachment GtkLabel-Justification.png is from gtk.php in the php-gtk
test directory, and shows the effect of justification on multiple line
labels.
Attachment GtkLabels-in-GtkTable.png is from pptp-php-gtk.php, the GUI
for the PPTP Client project, and shows how to use X Alignment to justify
the labels within the table cells they inhabit. You can see how the
labels in the left most column are right justified using an X alignment
of 1.0, and the labels in the right most column are left justified with
an alignment of 0.0. I've used The Gimp to highlight the areas.
The widget tree for this notebook tab is;
GtkNotebook
|
+-- GtkTable
|
+-- GtkLabel x 10, GtkEntry x 10
(Steph: you're welcome to use the text above in the manual, tutorial, or
Wiki.)
--
James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/