Re: [gtk-list] Justifying labels



>>>>> "S" == Sukanta Kumar Hazra <eng70884@leonis.nus.edu.sg> writes:

 [snip]

 S> I have tried using gtk_label_set_justify, but that didn't
 S> help. Its still appears at the center of the cell.

maybe faq entry no 6.9 will help:

6.9 How do I right (or otherwise) justify a GtkLabel?

 Are you sure you want to justify the labels? The label class contains
 the gtk_label_set_justify() function that is used to control the
 justification of a multi-line label.

 What you probably want is to set the alignment of the label, ie right
 align it, center it or left align it. If you want to do this, you
 should use:

 void gtk_misc_set_alignment (GtkMisc *misc,
                              gfloat xalign,
                              gfloat yalign);

 where the xalign and yalign values are floats in [0.00;1.00]. 

        GtkWidget       *label;

        /* horizontal : left align, vertical : top */
        gtk_misc_set_alignment(GTK_MISK(label), 0.0f, 0.0f);

        /* horizontal : centered, vertical : centered */
        gtk_misc_set_alignment(GTK_MISK(label), 0.5f, 0.5f);

        /* horizontal : right align, vertical : bottom */
        gtk_misc_set_alignment(GTK_MISK(label), 1.0f, 1.0f);



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