Label justification




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);

...



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