/*
 * Label #120411 bug test case
 */

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>


gchar * chinese_string = "对于大多数现代的电视卡，GNU/Linux 内核的 bttv 模块能自动检测正确的参数。"
"如果自动检测不适合您的卡，您可以在这里强制设定正确的调协器及卡的类型。只有必要时才设置电视卡参数。<";


int main (int argc, char *argv[]) {
  GtkWidget *window;
  GtkWidget *vbox;
  GtkWidget *label;
  GtkWidget *scrolledwindow;
  GtkWidget *textview;

  gtk_set_locale ();
  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (window), "#120411 (GtkLabel bug) test case");
  gtk_window_set_default_size (GTK_WINDOW (window), 300, 300);

  vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox);
  gtk_container_add (GTK_CONTAINER (window), vbox);

  label = gtk_label_new (chinese_string);
  gtk_widget_show (label);
  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
  gtk_widget_set_size_request (label, 121, 100);
  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);

  scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_show (scrolledwindow);
  gtk_box_pack_start (GTK_BOX (vbox), scrolledwindow, TRUE, TRUE, 0);

  textview = gtk_text_view_new ();
  gtk_widget_show (textview);
  gtk_container_add (GTK_CONTAINER (scrolledwindow), textview);
  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview), GTK_WRAP_WORD);
  gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview)), chinese_string, -1);

  gtk_widget_show (window);

  gtk_main ();
  return 0;
}

