2002-08-11 Miguel de Icaza <miguel@ximian.com>

* glub/adjustment.c: C-side of the Adjustment glue.

	* gtk/Adjustment.custom: Add new SetBounds function that allows us
	to change the adjustment after it has been created.

svn path=/trunk/gtk-sharp/; revision=6587
This commit is contained in:
Miguel de Icaza 2002-08-11 22:48:00 +00:00
parent fce41ef511
commit a5d2c9f567
3 changed files with 43 additions and 0 deletions

View file

@ -1,6 +1,7 @@
lib_LTLIBRARIES = libgtksharpglue.la
BASESOURCES = \
adjustment.c \
value.c \
fileselection.c \
dialog.c \

23
glue/adjustment.c Normal file
View file

@ -0,0 +1,23 @@
/*
* Utility wrapper for the GtkAdjustment
*
* (C) 2002 Miguel de Icaza (miguel@ximian.com)
*/
#include <gtk/gtkadjustment.h>
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);
}

19
gtk/Adjustment.custom Normal file
View file

@ -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);
/// <summary>Sets the Adjustment boundaries</summary>
/// <remarks>
/// 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
/// </remarks>
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);
}