Commit a665c308 authored by Michael Natterer's avatar Michael Natterer 😴

app: gimp_spin_button_new() -> gtk_spin_button_new()

parent eaea58f5
......@@ -100,7 +100,7 @@ convert_type_dialog_new (GimpImage *image,
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *label;
GtkObject *adjustment;
GtkAdjustment *adjustment;
GtkWidget *spinbutton;
GtkWidget *frame;
GtkWidget *toggle;
......@@ -197,8 +197,10 @@ convert_type_dialog_new (GimpImage *image,
if (dialog->num_colors == 256 && gimp_image_has_alpha (image))
dialog->num_colors = 255;
spinbutton = gimp_spin_button_new (&adjustment, dialog->num_colors,
2, 256, 1, 8, 0, 1, 0);
adjustment = (GtkAdjustment *)
gtk_adjustment_new (dialog->num_colors, 2, 256, 1, 8, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinbutton);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
......
......@@ -68,7 +68,7 @@ layer_options_dialog_new (GimpImage *image,
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
GtkObject *adjustment;
GtkAdjustment *adjustment;
GtkWidget *spinbutton;
GtkWidget *frame;
GtkWidget *button;
......@@ -152,9 +152,10 @@ layer_options_dialog_new (GimpImage *image,
gtk_widget_show (label);
/* The size sizeentry */
spinbutton = gimp_spin_button_new (&adjustment,
1, 1, 1, 1, 10, 0,
1, 2);
adjustment = (GtkAdjustment *)
gtk_adjustment_new (1, 1, 1, 1, 10, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
options->size_se = gimp_size_entry_new (1, GIMP_UNIT_PIXEL, "%a",
......
......@@ -81,19 +81,19 @@ offset_dialog_new (GimpDrawable *drawable,
GimpContext *context,
GtkWidget *parent)
{
GimpItem *item;
OffsetDialog *dialog;
GtkWidget *main_vbox;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *spinbutton;
GtkWidget *frame;
GtkWidget *radio_button;
GtkObject *adjustment;
gdouble xres;
gdouble yres;
const gchar *title = NULL;
GimpItem *item;
OffsetDialog *dialog;
GtkWidget *main_vbox;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *button;
GtkWidget *spinbutton;
GtkWidget *frame;
GtkWidget *radio_button;
GtkAdjustment *adjustment;
gdouble xres;
gdouble yres;
const gchar *title = NULL;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
......@@ -161,9 +161,10 @@ offset_dialog_new (GimpDrawable *drawable,
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
spinbutton = gimp_spin_button_new (&adjustment,
1, 1, 1, 1, 10, 0,
1, 2);
adjustment = (GtkAdjustment *)
gtk_adjustment_new (1, 1, 1, 1, 10, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 10);
dialog->off_se = gimp_size_entry_new (1, GIMP_UNIT_PIXEL, "%a",
......
......@@ -93,7 +93,7 @@ print_size_dialog_new (GimpImage *image,
GtkWidget *height;
GtkWidget *hbox;
GtkWidget *chain;
GtkObject *adj;
GtkAdjustment *adj;
GList *focus_chain = NULL;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
......@@ -151,10 +151,14 @@ print_size_dialog_new (GimpImage *image,
/* the print size entry */
width = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
width = gtk_spin_button_new (adj, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (width), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (width), SB_WIDTH);
height = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
height = gtk_spin_button_new (adj, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (height), SB_WIDTH);
entry = gimp_size_entry_new (0, gimp_get_default_unit (), "%p",
......@@ -213,10 +217,14 @@ print_size_dialog_new (GimpImage *image,
/* the resolution entry */
width = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
width = gtk_spin_button_new (adj, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (width), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (width), SB_WIDTH);
height = gimp_spin_button_new (&adj, 1, 1, 1, 1, 10, 0, 1, 2);
adj = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
height = gtk_spin_button_new (adj, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (height), SB_WIDTH);
label = gtk_label_new_with_mnemonic (_("_X resolution:"));
......
......@@ -90,21 +90,21 @@ resize_dialog_new (GimpViewable *viewable,
GimpResizeCallback callback,
gpointer user_data)
{
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *vbox;
GtkWidget *abox;
GtkWidget *frame;
GtkWidget *button;
GtkWidget *spinbutton;
GtkWidget *entry;
GtkObject *adjustment;
GdkPixbuf *pixbuf;
ResizeDialog *private;
GimpImage *image = NULL;
const gchar *text = NULL;
gint width, height;
gdouble xres, yres;
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *vbox;
GtkWidget *abox;
GtkWidget *frame;
GtkWidget *button;
GtkWidget *spinbutton;
GtkWidget *entry;
GtkAdjustment *adjustment;
GdkPixbuf *pixbuf;
ResizeDialog *private;
GimpImage *image = NULL;
const gchar *text = NULL;
gint width, height;
gdouble xres, yres;
g_return_val_if_fail (GIMP_IS_VIEWABLE (viewable), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
......@@ -206,9 +206,9 @@ resize_dialog_new (GimpViewable *viewable,
gtk_widget_show (vbox);
/* the offset sizeentry */
spinbutton = gimp_spin_button_new (&adjustment,
1, 1, 1, 1, 10, 0,
1, 2);
adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
spinbutton = gtk_spin_button_new (adjustment, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), SB_WIDTH);
private->offset = entry = gimp_size_entry_new (1, unit, "%p",
......
......@@ -142,12 +142,12 @@ gimp_display_shell_rotate_dialog (GimpDisplayShell *shell)
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
spin = gimp_spin_button_new ((GtkObject **) &data->rotate_adj,
shell->rotate_angle,
0.0, 360.0,
1, 15, 0, 1, 2);
gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
data->rotate_adj = (GtkAdjustment *)
gtk_adjustment_new (shell->rotate_angle, 0.0, 360.0, 1, 15, 0);
spin = gtk_spin_button_new (data->rotate_adj, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin), TRUE);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spin), TRUE);
gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
gtk_box_pack_start (GTK_BOX (hbox), spin, TRUE, TRUE, 0);
gtk_widget_show (spin);
......
......@@ -164,9 +164,10 @@ gimp_display_shell_scale_dialog (GimpDisplayShell *shell)
gimp_zoom_model_get_fraction (data->model, &num, &denom);
spin = gimp_spin_button_new ((GtkObject **) &data->num_adj,
num, 1, 256,
1, 8, 0, 1, 0);
data->num_adj = (GtkAdjustment *)
gtk_adjustment_new (num, 1, 256, 1, 8, 0);
spin = gtk_spin_button_new (data->num_adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin), TRUE);
gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
gtk_box_pack_start (GTK_BOX (hbox), spin, TRUE, TRUE, 0);
gtk_widget_show (spin);
......@@ -175,9 +176,10 @@ gimp_display_shell_scale_dialog (GimpDisplayShell *shell)
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
spin = gimp_spin_button_new ((GtkObject **) &data->denom_adj,
denom, 1, 256,
1, 8, 0, 1, 0);
data->denom_adj = (GtkAdjustment *)
gtk_adjustment_new (denom, 1, 256, 1, 8, 0);
spin = gtk_spin_button_new (data->denom_adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin), TRUE);
gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
gtk_box_pack_start (GTK_BOX (hbox), spin, TRUE, TRUE, 0);
gtk_widget_show (spin);
......@@ -187,10 +189,12 @@ gimp_display_shell_scale_dialog (GimpDisplayShell *shell)
_("Zoom:"), 0.0, 0.5,
hbox, 1, FALSE);
spin = gimp_spin_button_new ((GtkObject **) &data->scale_adj,
fabs (shell->other_scale) * 100,
100.0 / 256.0, 25600.0,
10, 50, 0, 1, 2);
data->scale_adj = (GtkAdjustment *)
gtk_adjustment_new (fabs (shell->other_scale) * 100,
100.0 / 256.0, 25600.0,
10, 50, 0);
spin = gtk_spin_button_new (data->scale_adj, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin), TRUE);
gtk_entry_set_activates_default (GTK_ENTRY (spin), TRUE);
gtk_box_pack_start (GTK_BOX (hbox), spin, TRUE, TRUE, 0);
gtk_widget_show (spin);
......
......@@ -174,7 +174,7 @@ gimp_rotate_tool_dialog (GimpTransformTool *tr_tool)
GtkWidget *table;
GtkWidget *button;
GtkWidget *scale;
GtkObject *adj;
GtkAdjustment *adj;
table = gtk_table_new (4, 2, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
......@@ -184,8 +184,10 @@ gimp_rotate_tool_dialog (GimpTransformTool *tr_tool)
FALSE, FALSE, 0);
gtk_widget_show (table);
button = gimp_spin_button_new ((GtkObject **) &rotate->angle_adj,
0, -180, 180, 0.1, 15, 0, 2, 2);
rotate->angle_adj = (GtkAdjustment *)
gtk_adjustment_new (0, -180, 180, 0.1, 15, 0);
button = gtk_spin_button_new (rotate->angle_adj, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (button), TRUE);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (button), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("_Angle:"),
......@@ -202,7 +204,9 @@ gimp_rotate_tool_dialog (GimpTransformTool *tr_tool)
GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_widget_show (scale);
button = gimp_spin_button_new (&adj, 0, -1, 1, 1, 10, 0, 1, 2);
adj = (GtkAdjustment *) gtk_adjustment_new (0, -1, 1, 1, 10, 0);
button = gtk_spin_button_new (adj, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (button), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (button), SB_WIDTH);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, _("Center _X:"),
0.0, 0.5, button, 1, TRUE);
......
......@@ -150,7 +150,6 @@ gimp_colormap_editor_init (GimpColormapEditor *editor)
{
GtkWidget *frame;
GtkWidget *table;
GtkObject *adj;
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
......@@ -193,9 +192,13 @@ gimp_colormap_editor_init (GimpColormapEditor *editor)
gtk_box_pack_end (GTK_BOX (editor), table, FALSE, FALSE, 0);
gtk_widget_show (table);
editor->index_spinbutton = gimp_spin_button_new (&adj,
0, 0, 0, 1, 10, 0, 1.0, 0);
editor->index_adjustment = GTK_ADJUSTMENT (adj);
editor->index_adjustment = (GtkAdjustment *)
gtk_adjustment_new (0, 0, 0, 1, 10, 0);
editor->index_spinbutton = gtk_spin_button_new (editor->index_adjustment,
1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (editor->index_spinbutton),
TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Color index:"), 0.0, 0.5,
editor->index_spinbutton, 1, TRUE);
......
......@@ -75,7 +75,6 @@ gimp_histogram_box_init (GimpHistogramBox *box)
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *vbox2;
GtkObject *adjustment;
GtkWidget *frame;
GtkWidget *view;
GtkWidget *bar;
......@@ -142,34 +141,34 @@ gimp_histogram_box_init (GimpHistogramBox *box)
gtk_widget_show (hbox);
/* low spinbutton */
box->low_spinbutton = gimp_spin_button_new (&adjustment,
0.0, 0.0, 255.0, 1.0, 16.0, 0.0,
1.0, 0);
box->low_adj = GTK_ADJUSTMENT (adjustment);
box->low_adj = (GtkAdjustment *)
gtk_adjustment_new (0.0, 0.0, 255.0, 1.0, 16.0, 0.0);
box->low_spinbutton = gtk_spin_button_new (box->low_adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (box->low_spinbutton), TRUE);
gtk_box_pack_start (GTK_BOX (hbox), box->low_spinbutton, FALSE, FALSE, 0);
gtk_widget_show (box->low_spinbutton);
g_signal_connect (adjustment, "value-changed",
g_signal_connect (box->low_adj, "value-changed",
G_CALLBACK (gimp_histogram_box_low_adj_update),
box);
gimp_handle_bar_set_adjustment (GIMP_HANDLE_BAR (bar), 0,
GTK_ADJUSTMENT (adjustment));
GTK_ADJUSTMENT (box->low_adj));
/* high spinbutton */
box->high_spinbutton = gimp_spin_button_new (&adjustment,
255.0, 0.0, 255.0, 1.0, 16.0, 0.0,
1.0, 0);
box->high_adj = GTK_ADJUSTMENT (adjustment);
box->high_adj = (GtkAdjustment *)
gtk_adjustment_new (255.0, 0.0, 255.0, 1.0, 16.0, 0.0);
box->high_spinbutton = gtk_spin_button_new (box->high_adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (box->high_spinbutton), TRUE);
gtk_box_pack_end (GTK_BOX (hbox), box->high_spinbutton, FALSE, FALSE, 0);
gtk_widget_show (box->high_spinbutton);
g_signal_connect (adjustment, "value-changed",
g_signal_connect (box->high_adj, "value-changed",
G_CALLBACK (gimp_histogram_box_high_adj_update),
box);
gimp_handle_bar_set_adjustment (GIMP_HANDLE_BAR (bar), 2,
GTK_ADJUSTMENT (adjustment));
GTK_ADJUSTMENT (box->high_adj));
#ifdef DEBUG_VIEW
spinbutton = gimp_prop_spin_button_new (G_OBJECT (box->view), "border-width",
......
......@@ -169,7 +169,6 @@ gimp_palette_editor_init (GimpPaletteEditor *editor)
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *spinbutton;
GtkObject *adj;
editor->zoom_factor = 1.0;
editor->col_width = 0;
......@@ -250,12 +249,14 @@ gimp_palette_editor_init (GimpPaletteEditor *editor)
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
spinbutton = gimp_spin_button_new (&adj, 0, 0, 64, 1, 4, 0, 1, 0);
editor->columns_data = GTK_ADJUSTMENT (adj);
editor->columns_adj = (GtkAdjustment *)
gtk_adjustment_new (0, 0, 64, 1, 4, 0);
spinbutton = gtk_spin_button_new (editor->columns_adj, 1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
gtk_widget_show (spinbutton);
g_signal_connect (editor->columns_data, "value-changed",
g_signal_connect (editor->columns_adj, "value-changed",
G_CALLBACK (palette_editor_columns_changed),
editor);
}
......@@ -320,7 +321,7 @@ gimp_palette_editor_set_data (GimpDataEditor *editor,
{
GimpPaletteEditor *palette_editor = GIMP_PALETTE_EDITOR (editor);
g_signal_handlers_block_by_func (palette_editor->columns_data,
g_signal_handlers_block_by_func (palette_editor->columns_adj,
palette_editor_columns_changed,
editor);
......@@ -336,7 +337,7 @@ gimp_palette_editor_set_data (GimpDataEditor *editor,
palette_editor_invalidate_preview,
editor);
gtk_adjustment_set_value (palette_editor->columns_data, 0);
gtk_adjustment_set_value (palette_editor->columns_adj, 0);
}
GIMP_DATA_EDITOR_CLASS (parent_class)->set_data (editor, data);
......@@ -352,7 +353,7 @@ gimp_palette_editor_set_data (GimpDataEditor *editor,
G_CALLBACK (palette_editor_invalidate_preview),
editor);
gtk_adjustment_set_value (palette_editor->columns_data,
gtk_adjustment_set_value (palette_editor->columns_adj,
gimp_palette_get_columns (palette));
palette_editor_scroll_top_left (palette_editor);
......@@ -361,7 +362,7 @@ gimp_palette_editor_set_data (GimpDataEditor *editor,
palette_editor);
}
g_signal_handlers_unblock_by_func (palette_editor->columns_data,
g_signal_handlers_unblock_by_func (palette_editor->columns_adj,
palette_editor_columns_changed,
editor);
}
......
......@@ -39,7 +39,7 @@ struct _GimpPaletteEditor
GtkWidget *view;
GtkWidget *color_name;
GtkAdjustment *columns_data;
GtkAdjustment *columns_adj;
GtkWidget *color_dialog;
......
......@@ -136,7 +136,7 @@ gimp_template_editor_constructed (GObject *object)
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
GtkObject *adjustment;
GtkAdjustment *adjustment;
GtkWidget *width;
GtkWidget *height;
GtkWidget *xres;
......@@ -166,14 +166,14 @@ gimp_template_editor_constructed (GObject *object)
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
width = gimp_spin_button_new (&adjustment,
1, 1, 1, 1, 10, 0,
1, 2);
adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
width = gtk_spin_button_new (adjustment, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (width), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (width), SB_WIDTH);
height = gimp_spin_button_new (&adjustment,
1, 1, 1, 1, 10, 0,
1, 2);
adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
height = gtk_spin_button_new (adjustment, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (height), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (height), SB_WIDTH);
/* the image size labels */
......@@ -295,14 +295,14 @@ gimp_template_editor_constructed (GObject *object)
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
xres = gimp_spin_button_new (&adjustment,
1, 1, 1, 1, 10, 0,
1, 2);
adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
xres = gtk_spin_button_new (adjustment, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (xres), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (xres), SB_WIDTH);
yres = gimp_spin_button_new (&adjustment,
1, 1, 1, 1, 10, 0,
1, 2);
adjustment = (GtkAdjustment *) gtk_adjustment_new (1, 1, 1, 1, 10, 0);
yres = gtk_spin_button_new (adjustment, 1.0, 2);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (yres), TRUE);
gtk_entry_set_width_chars (GTK_ENTRY (yres), SB_WIDTH);
/* the resolution labels */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment