diff --git a/glue/Makefile.am b/glue/Makefile.am index 468f9a65f..16207d045 100644 --- a/glue/Makefile.am +++ b/glue/Makefile.am @@ -1,6 +1,7 @@ lib_LTLIBRARIES = libgtksharpglue.la BASESOURCES = \ + adjustment.c \ value.c \ fileselection.c \ dialog.c \ diff --git a/glue/adjustment.c b/glue/adjustment.c new file mode 100644 index 000000000..40618b4bd --- /dev/null +++ b/glue/adjustment.c @@ -0,0 +1,23 @@ +/* + * Utility wrapper for the GtkAdjustment + * + * (C) 2002 Miguel de Icaza (miguel@ximian.com) + */ + +#include + +void +gtksharp_gtk_adjustment_set_bounds (GtkAdjustment *adj, + gdouble lower, gdouble upper, + gdouble step_increment, + gdouble page_increment, gdouble page_size) +{ + adj->lower = lower; + adj->upper = upper; + adj->step_increment = step_increment; + adj->page_increment = page_increment; + adj->page_size = page_size; + + gtk_adjustment_changed (adj); +} + diff --git a/gtk/Adjustment.custom b/gtk/Adjustment.custom new file mode 100644 index 000000000..42d9fb9e7 --- /dev/null +++ b/gtk/Adjustment.custom @@ -0,0 +1,19 @@ +// +// Gtk.Adjustment.custom - Allow customization of values in the GtkAdjustment +// +// This code is inserted after the automatically generated code. +// + +[DllImport("gtksharpglue")] +static extern void gtksharp_gtk_adjustment_set_bounds (IntPtr i, double lower, double upper, double step_increment, double page_increment, double page_size); + +/// Sets the Adjustment boundaries +/// +/// This method is used to change the lower, upper, step_increment, page_increment and +/// page_size parameters of the Adjustment object after it has been created +/// +public void SetBounds (double lower, double upper, double step_increment, double page_increment, double page_size) +{ + gtksharp_gtk_adjustment_set_bounds (this.Handle, lower, upper, step_increment, page_increment, page_size); +} +