/*
- * $Id: rb_esmart_container.c 297 2005-03-18 18:49:46Z tilman $
+ * $Id: rb_esmart_container.c 317 2005-04-25 21:48:10Z tilman $
*
* Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
*
return Qnil;
}
+static VALUE c_scroll_percent_get (VALUE self)
+{
+ double val;
+
+ GET_OBJ (self, RbContainer, e);
+
+ val = esmart_container_scroll_percent_get (e->real.real);
+
+ return rb_float_new (val);
+}
+
+static VALUE c_scroll_percent_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbContainer, e);
+
+ Check_Type (val, T_FLOAT);
+
+ esmart_container_scroll_percent_set (e->real.real, NUM2DBL (val));
+
+ return Qnil;
+}
+
void Init_esmart_container (void)
{
VALUE c;
rb_define_method (c, "elements_orig_length",
c_elements_orig_length_get, 0);
rb_define_method (c, "scroll", c_scroll, 1);
+ rb_define_method (c, "scroll_percent", c_scroll_percent_get, 0);
+ rb_define_method (c, "scroll_percent=", c_scroll_percent_set, 1);
rb_define_const (c, "HORIZONTAL",
INT2FIX (CONTAINER_DIRECTION_HORIZONTAL));