Re: Centered texts often don't look nice



You can left justify the text in a GtkLabel with the following command:
  gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);

This will shift the text to the left edge of its allocation.  If you want
to get a multi line label left justified with respect to the other lines,
you will also need:
  gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);

James.

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


On 16 Apr 2000, Karl EICHWALDER wrote:

> Pretty often, texts are centered.  The texts would look much better if
> they were presented left justified.
> 
> Is this a known limitation or is it useful that I start to report these
> cases as bugs?  Here's one example
> (gnome-utils/gsearchtool/gsearchtool.c):
> 
> static GtkWidget *
> create_locate_page(void)
> {
> 	GtkWidget *w, *vbox, *hbox;
> 	static GtkWidget *buttons[2];
> 
> 	vbox = gtk_vbox_new(FALSE, GNOME_PAD_SMALL);
> 	gtk_container_border_width(GTK_CONTAINER(vbox), GNOME_PAD_SMALL);
> 
> 	w = gtk_label_new(_("This is an interface to locate.  If you type in "
> 			    "a simple string it\nwill be matched as a subset "
> 			    "of the full path, and if you type\nin a string "
> 			    "with wildcards, it will have to match the full "
> 			    "path."));
> 	gtk_box_pack_start(GTK_BOX(vbox), w, FALSE, FALSE, 0);
> 
> You'll find much more examples in preferences dialogs.
> 
> -- 
> work : ke@suse.de                          |
>: http://www.suse.de/~ke/             |          ------    ,__o
> home : ke@gnu.franken.de                   |         ------   _-\_<,
>: http://www.franken.de/users/gnu/ke/ |        ------   (*)/'(*)
> 
> 
> -- 
> 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]