Re: nuts!



On Tue, Jul 29, 2014 at 6:36 AM, Chris Vine <chris cvine freeserve co uk> wrote:
On Mon, 28 Jul 2014 23:00:34 -0700
Gary Kline <kline thought org> wrote:
while I can create several {N} labels, they print centered. how do I get the labels to print from the left side of the window widget:

Use 'gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5)' to align left,
and 'gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5)' to align right.
For multi-line labels, you would also want to call gtk_set_justify().



Note that since GTK+-3.0 there are the 'halign' and 'valign' properties
of GtkWidget which accomplish the same as setting the GtkMisc alignment
properties.

These are preferred and the GtkMisc API, while not officially deprecated,
is not recommended for use in new code[0].

Instead, you should be able to use:
  gtk_widget_set_halign (label, GTK_ALIGN_START);


This should align whatever widget to the left of the available space for
the given widget (or to the right in RTL mode) - this API can also be used
for any widget (it is not limited to GtkMisc derived widgets).

Cheers,
   -Tristan

[0]: https://developer.gnome.org/gtk3/stable/GtkMisc.html






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