[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    Re: Justification of Labels
From:       Havoc Pennington <rhp () zirx ! pair ! com>
Date:       1999-07-04 14:13:05
[Download RAW message or body]


Hi,

gtk_label_set_justify() changes the alignment of multiple label lines with
respect to one another. So, say you have two lines; with left-justify the
start of each line aligns, with center, the center of each line, and with
right, the end of each line.

gtk_misc_set_alignment() (which is probably what you wanted) sets the
position of the entire block of lines in the label. That is, once the
label has been justified, you can put all the text to the left of the
label, to the right, or in the center of the label's size allocation. 
To left-justify, call gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
(0.0 = left, 0.5 = center, 1.0 = right, the third arg is vertical
alignment).

When you added the hbox, you inadvertently changed things so that the
label did not receive a size allocation larger than its size request. That
is, the label was just large enough to display all its text so the
alignment was irrelevant. It appeared left-justified because it happened
to be positioned in the left end of the box. Without the box, the label
was filling the table cell so it had extra space to align the text within.
(With the box, the extra space was going to the box and not being passed
to the label, because you called gtk_box_pack_start() with FALSE, TRUE 
instead of TRUE, TRUE.)

Havoc



-- 
         To unsubscribe: mail gtk-app-devel-list-request@redhat.com with 
                       "unsubscribe" as the Subject.

	Mailing list concerns should be mailed to <listmaster@redhat.com>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic