patch from lars for construct behaviour.

-timj
This commit is contained in:
Tim Janik 1998-03-09 07:18:33 +00:00
parent d894d2dc0c
commit c9f7f2a0f8
9 changed files with 79 additions and 10 deletions

View File

@ -1,3 +1,10 @@
Mon Mar 9 08:07:01 1998 Tim Janik <timj@gimp.org>
* gtk/gtkspinbutton.h:
* gtk/gtkspinbutton.c:
applied gtk-hamann_jeske-980308-0.patch.gz to have a
gtk_spin_button_construct() function
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a

View File

@ -1,3 +1,10 @@
Mon Mar 9 08:07:01 1998 Tim Janik <timj@gimp.org>
* gtk/gtkspinbutton.h:
* gtk/gtkspinbutton.c:
applied gtk-hamann_jeske-980308-0.patch.gz to have a
gtk_spin_button_construct() function
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a

View File

@ -1,3 +1,10 @@
Mon Mar 9 08:07:01 1998 Tim Janik <timj@gimp.org>
* gtk/gtkspinbutton.h:
* gtk/gtkspinbutton.c:
applied gtk-hamann_jeske-980308-0.patch.gz to have a
gtk_spin_button_construct() function
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a

View File

@ -1,3 +1,10 @@
Mon Mar 9 08:07:01 1998 Tim Janik <timj@gimp.org>
* gtk/gtkspinbutton.h:
* gtk/gtkspinbutton.c:
applied gtk-hamann_jeske-980308-0.patch.gz to have a
gtk_spin_button_construct() function
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a

View File

@ -1,3 +1,10 @@
Mon Mar 9 08:07:01 1998 Tim Janik <timj@gimp.org>
* gtk/gtkspinbutton.h:
* gtk/gtkspinbutton.c:
applied gtk-hamann_jeske-980308-0.patch.gz to have a
gtk_spin_button_construct() function
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a

View File

@ -1,3 +1,10 @@
Mon Mar 9 08:07:01 1998 Tim Janik <timj@gimp.org>
* gtk/gtkspinbutton.h:
* gtk/gtkspinbutton.c:
applied gtk-hamann_jeske-980308-0.patch.gz to have a
gtk_spin_button_construct() function
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a

View File

@ -1,3 +1,10 @@
Mon Mar 9 08:07:01 1998 Tim Janik <timj@gimp.org>
* gtk/gtkspinbutton.h:
* gtk/gtkspinbutton.c:
applied gtk-hamann_jeske-980308-0.patch.gz to have a
gtk_spin_button_construct() function
Mon Mar 9 01:01:41 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkrc.c: No, you can't add a GtkStyle * to a

View File

@ -162,26 +162,40 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
spin_button->digits = 0;
}
GtkWidget*
void
gtk_spin_button_construct (GtkSpinButton *spin_button,
GtkAdjustment *adjustment,
gfloat climb_rate,
gint digits)
{
char buf[MAX_TEXT_LENGTH];
g_return_if_fail (spin_button != NULL);
g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
g_return_if_fail (digits >= 0 && digits < 128);
if (!adjustment)
adjustment = (GtkAdjustment*) gtk_adjustment_new (0, 0, 0, 0, 0, 0);
gtk_spin_button_set_adjustment (spin_button, adjustment);
spin_button->digits = digits;
sprintf (buf, "%0.*f", digits, adjustment->value);
gtk_entry_set_text (GTK_ENTRY (spin_button), buf);
spin_button->climb_rate = climb_rate;
}
GtkWidget *
gtk_spin_button_new (GtkAdjustment *adjustment,
gfloat climb_rate,
gint digits)
{
GtkSpinButton *spin;
char buf[MAX_TEXT_LENGTH];
g_return_val_if_fail (digits >= 0 && digits < 128, NULL);
spin = gtk_type_new (gtk_spin_button_get_type ());
if (!adjustment)
adjustment = (GtkAdjustment*) gtk_adjustment_new (0, 0, 0, 0, 0, 0);
gtk_spin_button_set_adjustment (GTK_SPIN_BUTTON (spin), adjustment);
spin->digits = digits;
sprintf (buf, "%0.*f", digits, adjustment->value);
gtk_entry_set_text (GTK_ENTRY (spin), buf);
spin->climb_rate = climb_rate;
gtk_spin_button_construct (spin, adjustment, climb_rate, digits);
return GTK_WIDGET (spin);
}

View File

@ -79,6 +79,12 @@ struct _GtkSpinButtonClass
guint
gtk_spin_button_get_type (void);
void
gtk_spin_button_construct (GtkSpinButton *spin_button,
GtkAdjustment *adjustment,
gfloat climb_rate,
gint digits);
GtkWidget *
gtk_spin_button_new (GtkAdjustment *adjustment,
gfloat climb_rate,