Ejemplo n.º 1
0
static void
gimp_levels_tool_dialog (GimpImageMapTool *im_tool)
{
  GimpLevelsTool   *tool         = GIMP_LEVELS_TOOL (im_tool);
  GimpToolOptions  *tool_options = GIMP_TOOL_GET_OPTIONS (im_tool);
  GimpLevelsConfig *config       = GIMP_LEVELS_CONFIG (im_tool->config);
  GtkListStore     *store;
  GtkWidget        *main_vbox;
  GtkWidget        *frame_vbox;
  GtkWidget        *vbox;
  GtkWidget        *vbox2;
  GtkWidget        *vbox3;
  GtkWidget        *hbox;
  GtkWidget        *hbox2;
  GtkWidget        *label;
  GtkWidget        *main_frame;
  GtkWidget        *frame;
  GtkWidget        *button;
  GtkWidget        *spinbutton;
  GtkAdjustment    *adjustment;
  GtkWidget        *bar;
  GtkWidget        *handle_bar;
  gint              border;

  g_signal_connect (im_tool->settings_box, "file-dialog-setup",
                    G_CALLBACK (gimp_levels_tool_export_setup),
                    im_tool);

  main_vbox = gimp_image_map_tool_dialog_get_vbox (im_tool);

  /*  The combo box for selecting channels  */
  main_frame = gimp_frame_new (NULL);
  gtk_box_pack_start (GTK_BOX (main_vbox), main_frame, TRUE, TRUE, 0);
  gtk_widget_show (main_frame);

  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
  gtk_frame_set_label_widget (GTK_FRAME (main_frame), hbox);
  gtk_widget_show (hbox);

  label = gtk_label_new_with_mnemonic (_("Cha_nnel:"));
  gimp_label_set_attributes (GTK_LABEL (label),
                             PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
                             -1);
  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  gtk_widget_show (label);

  store = gimp_enum_store_new_with_range (GIMP_TYPE_HISTOGRAM_CHANNEL,
                                          GIMP_HISTOGRAM_VALUE,
                                          GIMP_HISTOGRAM_ALPHA);
  tool->channel_menu =
    gimp_enum_combo_box_new_with_model (GIMP_ENUM_STORE (store));
  g_object_unref (store);

  gimp_enum_combo_box_set_icon_prefix (GIMP_ENUM_COMBO_BOX (tool->channel_menu),
                                       "gimp-channel");
  gtk_box_pack_start (GTK_BOX (hbox), tool->channel_menu, FALSE, FALSE, 0);
  gtk_widget_show (tool->channel_menu);

  g_signal_connect (tool->channel_menu, "changed",
                    G_CALLBACK (levels_channel_callback),
                    tool);

  gtk_label_set_mnemonic_widget (GTK_LABEL (label), tool->channel_menu);

  button = gtk_button_new_with_mnemonic (_("R_eset Channel"));
  gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  g_signal_connect (button, "clicked",
                    G_CALLBACK (levels_channel_reset_callback),
                    tool);

  hbox2 = gimp_prop_enum_icon_box_new (G_OBJECT (tool_options),
                                       "histogram-scale", "gimp-histogram",
                                       0, 0);
  gtk_box_pack_end (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0);
  gtk_widget_show (hbox2);

  frame_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
  gtk_container_add (GTK_CONTAINER (main_frame), frame_vbox);
  gtk_widget_show (frame_vbox);

  /*  Input levels frame  */
  frame = gimp_frame_new (_("Input Levels"));
  gtk_box_pack_start (GTK_BOX (frame_vbox), frame, TRUE, TRUE, 0);
  gtk_widget_show (frame);

  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
  gtk_container_add (GTK_CONTAINER (frame), vbox);
  gtk_widget_show (vbox);

  frame = gtk_frame_new (NULL);
  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
  gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
  gtk_widget_show (frame);

  vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
  gtk_container_add (GTK_CONTAINER (frame), vbox2);
  gtk_widget_show (vbox2);

  tool->histogram_view = gimp_histogram_view_new (FALSE);
  gtk_box_pack_start (GTK_BOX (vbox2), tool->histogram_view, TRUE, TRUE, 0);
  gtk_widget_show (GTK_WIDGET (tool->histogram_view));

  gimp_histogram_options_connect_view (GIMP_HISTOGRAM_OPTIONS (tool_options),
                                       GIMP_HISTOGRAM_VIEW (tool->histogram_view));

  g_object_get (tool->histogram_view, "border-width", &border, NULL);

  vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox3), border);
  gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
  gtk_widget_show (vbox3);

  tool->input_bar = g_object_new (GIMP_TYPE_COLOR_BAR, NULL);
  gtk_widget_set_size_request (tool->input_bar, -1, GRADIENT_HEIGHT / 2);
  gtk_box_pack_start (GTK_BOX (vbox3), tool->input_bar, FALSE, FALSE, 0);
  gtk_widget_show (tool->input_bar);

  bar = g_object_new (GIMP_TYPE_COLOR_BAR, NULL);
  gtk_widget_set_size_request (bar, -1, GRADIENT_HEIGHT / 2);
  gtk_box_pack_start (GTK_BOX (vbox3), bar, FALSE, FALSE, 0);
  gtk_widget_show (bar);

  handle_bar = g_object_new (GIMP_TYPE_HANDLE_BAR, NULL);
  gtk_widget_set_size_request (handle_bar, -1, CONTROL_HEIGHT);
  gtk_box_pack_start (GTK_BOX (vbox3), handle_bar, FALSE, FALSE, 0);
  gtk_widget_show (handle_bar);

  gimp_handle_bar_connect_events (GIMP_HANDLE_BAR (handle_bar),
                                  tool->input_bar);
  gimp_handle_bar_connect_events (GIMP_HANDLE_BAR (handle_bar),
                                  bar);

  /*  Horizontal box for input levels spinbuttons  */
  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
  gtk_widget_show (hbox);

  /*  low input spin  */
  hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
  gtk_box_pack_start (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0);
  gtk_widget_show (hbox2);

  button = gimp_levels_tool_color_picker_new (tool, PICK_LOW_INPUT);
  gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  tool->low_input_spinbutton = spinbutton =
    gimp_prop_spin_button_new (im_tool->config, "low-input",
                               0.01, 0.1, 1);
  gtk_box_pack_start (GTK_BOX (hbox2), spinbutton, FALSE, FALSE, 0);
  gtk_widget_show (spinbutton);

  tool->low_input = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton));
  gimp_handle_bar_set_adjustment (GIMP_HANDLE_BAR (handle_bar), 0,
                                  tool->low_input);

  /*  input gamma spin  */
  spinbutton = gimp_prop_spin_button_new (im_tool->config, "gamma",
                                          0.01, 0.1, 2);
  gtk_box_pack_start (GTK_BOX (hbox), spinbutton, TRUE, FALSE, 0);
  gimp_help_set_help_data (spinbutton, _("Gamma"), NULL);
  gtk_widget_show (spinbutton);

  tool->gamma = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton));

  tool->gamma_linear = GTK_ADJUSTMENT (gtk_adjustment_new (127, 0, 255,
                                                           0.1, 1.0, 0.0));
  g_signal_connect (tool->gamma_linear, "value-changed",
                    G_CALLBACK (levels_linear_gamma_changed),
                    tool);

  gimp_handle_bar_set_adjustment (GIMP_HANDLE_BAR (handle_bar), 1,
                                  tool->gamma_linear);
  g_object_unref (tool->gamma_linear);

  /*  high input spin  */
  hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
  gtk_box_pack_end (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0);
  gtk_widget_show (hbox2);

  button = gimp_levels_tool_color_picker_new (tool, PICK_HIGH_INPUT);
  gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  spinbutton = gimp_prop_spin_button_new (im_tool->config, "high-input",
                                          0.01, 0.1, 1);
  gtk_box_pack_start (GTK_BOX (hbox2), spinbutton, FALSE, FALSE, 0);
  gtk_widget_show (spinbutton);
  tool->high_input_spinbutton = spinbutton;

  tool->high_input = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton));
  gimp_handle_bar_set_adjustment (GIMP_HANDLE_BAR (handle_bar), 2,
                                  tool->high_input);

  /*  Output levels frame  */
  frame = gimp_frame_new (_("Output Levels"));
  gtk_box_pack_start (GTK_BOX (frame_vbox), frame, FALSE, FALSE, 0);
  gtk_widget_show (frame);

  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
  gtk_container_add (GTK_CONTAINER (frame), vbox);
  gtk_widget_show (vbox);

  frame = gtk_frame_new (NULL);
  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
  gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
  gtk_widget_show (frame);

  vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
  gtk_container_set_border_width (GTK_CONTAINER (vbox2), border);
  gtk_container_add (GTK_CONTAINER (frame), vbox2);
  gtk_widget_show (vbox2);

  tool->output_bar = g_object_new (GIMP_TYPE_COLOR_BAR, NULL);
  gtk_widget_set_size_request (tool->output_bar, -1, GRADIENT_HEIGHT);
  gtk_box_pack_start (GTK_BOX (vbox2), tool->output_bar, FALSE, FALSE, 0);
  gtk_widget_show (tool->output_bar);

  handle_bar = g_object_new (GIMP_TYPE_HANDLE_BAR, NULL);
  gtk_widget_set_size_request (handle_bar, -1, CONTROL_HEIGHT);
  gtk_box_pack_start (GTK_BOX (vbox2), handle_bar, FALSE, FALSE, 0);
  gtk_widget_show (handle_bar);

  gimp_handle_bar_connect_events (GIMP_HANDLE_BAR (handle_bar),
                                  tool->output_bar);

  /*  Horizontal box for levels spin widgets  */
  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
  gtk_widget_show (hbox);

  /*  low output spin  */
  tool->low_output_spinbutton = spinbutton =
    gimp_prop_spin_button_new (im_tool->config, "low-output",
                               0.01, 0.1, 1);
  gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
  gtk_widget_show (spinbutton);

  adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton));
  gimp_handle_bar_set_adjustment (GIMP_HANDLE_BAR (handle_bar), 0, adjustment);

  /*  high output spin  */
  tool->high_output_spinbutton = spinbutton =
    gimp_prop_spin_button_new (im_tool->config, "high-output",
                               0.01, 0.1, 1);
  gtk_box_pack_end (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
  gtk_widget_show (spinbutton);

  adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinbutton));
  gimp_handle_bar_set_adjustment (GIMP_HANDLE_BAR (handle_bar), 2, adjustment);


  /*  all channels frame  */
  main_frame = gimp_frame_new (_("All Channels"));
  gtk_box_pack_start (GTK_BOX (main_vbox), main_frame, FALSE, FALSE, 0);
  gtk_widget_show (main_frame);

  frame_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
  gtk_container_add (GTK_CONTAINER (main_frame), frame_vbox);
  gtk_widget_show (frame_vbox);

  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
  gtk_box_pack_start (GTK_BOX (frame_vbox), hbox, FALSE, FALSE, 0);
  gtk_widget_show (hbox);

  button = gtk_button_new_with_mnemonic (_("_Auto Input Levels"));
  gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
  gimp_help_set_help_data (button,
                           _("Adjust levels for all channels automatically"),
                           NULL);
  gtk_widget_show (button);

  g_signal_connect (button, "clicked",
                    G_CALLBACK (levels_stretch_callback),
                    tool);

  button = gimp_levels_tool_color_picker_new (tool,
                                              PICK_HIGH_INPUT |
                                              PICK_ALL_CHANNELS);
  gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  button = gimp_levels_tool_color_picker_new (tool,
                                              PICK_GAMMA |
                                              PICK_ALL_CHANNELS);
  gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  button = gimp_levels_tool_color_picker_new (tool,
                                              PICK_LOW_INPUT |
                                              PICK_ALL_CHANNELS);
  gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  button = gimp_icon_button_new (GIMP_STOCK_TOOL_CURVES,
                                 _("Edit these Settings as Curves"));
  gtk_box_pack_start (GTK_BOX (main_vbox), button, FALSE, FALSE, 0);
  gtk_widget_show (button);

  g_signal_connect (button, "clicked",
                    G_CALLBACK (levels_to_curves_callback),
                    tool);

  gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (tool->channel_menu),
                                 config->channel);
}
Ejemplo n.º 2
0
GtkWidget *
gimp_paint_options_gui (GimpToolOptions *tool_options)
{
    GObject          *config  = G_OBJECT (tool_options);
    GimpPaintOptions *options = GIMP_PAINT_OPTIONS (tool_options);
    GtkWidget        *vbox    = gimp_tool_options_gui (tool_options);
    GtkWidget        *menu;
    GtkWidget        *scale;
    GType             tool_type;

    tool_type = tool_options->tool_info->tool_type;

    /*  the paint mode menu  */
    menu = gimp_prop_paint_mode_menu_new (config, "paint-mode", TRUE, FALSE);
    gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (menu), _("Mode"));
    g_object_set (menu, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
    gtk_box_pack_start (GTK_BOX (vbox), menu, FALSE, FALSE, 0);
    gtk_widget_show (menu);

    if (tool_type == GIMP_TYPE_ERASER_TOOL     ||
            tool_type == GIMP_TYPE_CONVOLVE_TOOL   ||
            tool_type == GIMP_TYPE_DODGE_BURN_TOOL ||
            tool_type == GIMP_TYPE_HEAL_TOOL       ||
            tool_type == GIMP_TYPE_SMUDGE_TOOL)
    {
        gtk_widget_set_sensitive (menu, FALSE);
    }

    /*  the opacity scale  */
    scale = gimp_prop_spin_scale_new (config, "opacity",
                                      _("Opacity"),
                                      0.01, 0.1, 0);
    gimp_prop_widget_set_factor (scale, 100.0, 0.0, 0.0, 1);
    gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
    gtk_widget_show (scale);

    /*  temp debug foo  */
    if (g_type_is_a (tool_type, GIMP_TYPE_PAINT_TOOL))
    {
        GtkWidget *button;

        button = gimp_prop_check_button_new (config, "use-applicator",
                                             "Use GimpApplicator");
        gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
        gtk_widget_show (button);
    }

    /*  the brush  */
    if (g_type_is_a (tool_type, GIMP_TYPE_BRUSH_TOOL))
    {
        GtkWidget *button;
        GtkWidget *hbox;
        GtkWidget *frame;

        button = gimp_prop_brush_box_new (NULL, GIMP_CONTEXT (tool_options),
                                          _("Brush"), 2,
                                          "brush-view-type", "brush-view-size",
                                          "gimp-brush-editor");
        gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
        gtk_widget_show (button);

        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
        gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
        gtk_widget_show (hbox);

        scale = gimp_prop_spin_scale_new (config, "brush-size",
                                          _("Size"),
                                          1.0, 10.0, 2);
        gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (scale), 1.0, 1000.0);
        gimp_spin_scale_set_gamma (GIMP_SPIN_SCALE (scale), 1.7);
        gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
        gtk_widget_show (scale);

        button = gimp_icon_button_new (GIMP_STOCK_RESET, NULL);
        gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
        gtk_image_set_from_icon_name (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (button))),
                                      GIMP_STOCK_RESET, GTK_ICON_SIZE_MENU);
        gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
        gtk_widget_show (button);

        g_signal_connect (button, "clicked",
                          G_CALLBACK (gimp_paint_options_gui_reset_size),
                          options);

        gimp_help_set_help_data (button,
                                 _("Reset size to brush's native size"), NULL);

        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
        gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
        gtk_widget_show (hbox);

        scale = gimp_prop_spin_scale_new (config, "brush-aspect-ratio",
                                          _("Aspect Ratio"),
                                          0.1, 1.0, 2);
        gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
        gtk_widget_show (scale);

        button = gimp_icon_button_new (GIMP_STOCK_RESET, NULL);
        gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
        gtk_image_set_from_icon_name (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (button))),
                                      GIMP_STOCK_RESET, GTK_ICON_SIZE_MENU);
        gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
        gtk_widget_show (button);

        g_signal_connect (button, "clicked",
                          G_CALLBACK (gimp_paint_options_gui_reset_aspect_ratio),
                          options);

        gimp_help_set_help_data (button,
                                 _("Reset aspect ratio to brush's native"), NULL);

        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
        gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
        gtk_widget_show (hbox);

        scale = gimp_prop_spin_scale_new (config, "brush-angle",
                                          _("Angle"),
                                          1.0, 5.0, 2);
        gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0);
        gtk_widget_show (scale);

        button = gimp_icon_button_new (GIMP_STOCK_RESET, NULL);
        gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
        gtk_image_set_from_icon_name (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (button))),
                                      GIMP_STOCK_RESET, GTK_ICON_SIZE_MENU);
        gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
        gtk_widget_show (button);

        g_signal_connect (button, "clicked",
                          G_CALLBACK (gimp_paint_options_gui_reset_angle),
                          options);

        gimp_help_set_help_data (button,
                                 _("Reset angle to zero"), NULL);

        button = gimp_prop_dynamics_box_new (NULL, GIMP_CONTEXT (tool_options),
                                             _("Dynamics"), 2,
                                             "dynamics-view-type",
                                             "dynamics-view-size",
                                             "gimp-dynamics-editor");
        gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
        gtk_widget_show (button);

        frame = dynamics_options_gui (options, tool_type);
        gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
        gtk_widget_show (frame);

        frame = jitter_options_gui (options, tool_type);
        gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
        gtk_widget_show (frame);
    }

    /*  the "smooth stroke" options  */
    if (g_type_is_a (tool_type, GIMP_TYPE_PAINT_TOOL))
    {
        GtkWidget *frame;

        frame = smoothing_options_gui (options, tool_type);
        gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
        gtk_widget_show (frame);
    }

    /*  the "incremental" toggle  */
    if (tool_type == GIMP_TYPE_PENCIL_TOOL     ||
            tool_type == GIMP_TYPE_PAINTBRUSH_TOOL ||
            tool_type == GIMP_TYPE_ERASER_TOOL)
    {
        GtkWidget *button;

        button = gimp_prop_enum_check_button_new (config,
                 "application-mode",
                 _("Incremental"),
                 GIMP_PAINT_CONSTANT,
                 GIMP_PAINT_INCREMENTAL);
        gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
        gtk_widget_show (button);
    }

    /* the "hard edge" toggle */
    if (tool_type == GIMP_TYPE_ERASER_TOOL            ||
            tool_type == GIMP_TYPE_CLONE_TOOL             ||
            tool_type == GIMP_TYPE_HEAL_TOOL              ||
            tool_type == GIMP_TYPE_PERSPECTIVE_CLONE_TOOL ||
            tool_type == GIMP_TYPE_CONVOLVE_TOOL          ||
            tool_type == GIMP_TYPE_DODGE_BURN_TOOL        ||
            tool_type == GIMP_TYPE_SMUDGE_TOOL)
    {
        GtkWidget *button;

        button = gimp_prop_check_button_new (config, "hard", _("Hard edge"));
        gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
        gtk_widget_show (button);
    }

    return vbox;
}