Bug in GTK 1.2.8?

Setting right justify on labels doesn't seem to work... Below is a small
program to demonstrate the problem.

#include <gtk/gtk.h>

main(int argc, char *argv[])
  GtkWidget *window, *box, *label, *entry;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

  box   = gtk_hbox_new (TRUE, 0);
  label = gtk_label_new ("freddie");
  entry = gtk_entry_new ();

  // The line that doesn't work... should snuggle freddie up.
  gtk_label_set_justify (GTK_LABEL(label), GTK_JUSTIFY_RIGHT);

  gtk_box_pack_start (GTK_BOX(box), label, TRUE, TRUE, 0);
  gtk_box_pack_start (GTK_BOX(box), entry, TRUE, TRUE, 0);
  gtk_container_add (GTK_CONTAINER(window), box);

  gtk_widget_show_all (window);

  gtk_main ();
  return (0);

"freddie" should be snuggled up to the label, but it stubbornly remains
centered... Is this a bug in Gtk or am I missing something?

Thanks. :)

PS. While I'm here, is it possible to grey out widgets to show they're there
but inactive, like greyed out menu entries?


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