Re: Label justification



For left justification use:
   gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
For right justification use:
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);

The effects of gtk_label_set_justify are only apparent if the label
contains multiple lines of text -- it specifies the alignment of the lines
with respect to the other lines, rather than the widget's allocation.

James.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Sun, 12 Dec 1999, Niklas Lundell wrote:

> 
> How do label justification work? In the code snippet below, I  have created
> a Gnome dialog and two labels. The first label is right aligned and the
> other one is left aligned. However, when displayed both labels are centered.
> 
> Can anyone give me a hint!!!
> 
> / Niklas
> 
> ...
> 
> dlg = gnome_dialog_new(_("Some dialog"), NULL);
> vbox = gtk_vbox_new(false, 5);
> gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dlg)->vbox), vbox,  true, true, 0);
> 
> label = gtk_label_new(_("Label right"));
> gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
> gtk_box_pack_start(GTK_BOX(vbox), label, true, true, 0);
> 
> label = gtk_label_new(_("Label left"));
> gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
> gtk_box_pack_start(GTK_BOX(vbox), label, true, true, 0);
> 
> ...
> 
> 
> -- 
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]