summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-28 06:14:45 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-28 06:14:45 +0000
commit4cee02480155ac18d0ef2288e42424574141ce07 (patch)
tree86be9f12049301d0c15fee27353b5c04825e1986
parenta66aaeb22aceb2964c5a79420b29eca400dab532 (diff)
fujioto's patch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/gtk/gtk.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/ext/gtk/gtk.c b/ext/gtk/gtk.c
index 41e6874e199..1d0d241369b 100644
--- a/ext/gtk/gtk.c
+++ b/ext/gtk/gtk.c
@@ -4582,6 +4582,47 @@ entry_set_text(self, text)
}
static VALUE
+entry_append_text(self, text)
+ VALUE self, text;
+{
+ gtk_entry_append_text(GTK_ENTRY(get_widget(self)), STR2CSTR(text));
+ return self;
+}
+
+static VALUE
+entry_prepend_text(self, text)
+ VALUE self, text;
+{
+ gtk_entry_prepend_text(GTK_ENTRY(get_widget(self)), STR2CSTR(text));
+ return self;
+}
+
+static VALUE
+entry_set_position(self, position)
+ VALUE self, position;
+{
+ gtk_entry_set_position(GTK_ENTRY(get_widget(self)), NUM2INT(position));
+ return self;
+}
+
+static VALUE
+entry_get_text(self)
+ VALUE self;
+{
+ gchar* text;
+ text = gtk_entry_get_text(GTK_ENTRY(get_widget(self)));
+ return str_new2(text);
+}
+
+static VALUE
+entry_set_visibility(self, visibility)
+ VALUE self, visibility;
+{
+ gtk_entry_set_visibility(GTK_ENTRY(get_widget(self)), RTEST(visibility));
+ return self;
+}
+
+static VALUE
entry_set_editable(self, editable)
VALUE self, editable;
{
@@ -4590,6 +4631,14 @@ entry_set_editable(self, editable)
}
static VALUE
+entry_set_max_length(self, max)
+ VALUE self, max;
+{
+ gtk_entry_set_max_length(GTK_ENTRY(get_widget(self)), NUM2INT(max));
+ return self;
+}
+
+static VALUE
eventbox_initialize(self)
VALUE self;
{
@@ -6251,7 +6300,13 @@ Init_gtk()
/* Entry */
rb_define_method(gEntry, "initialize", entry_initialize, 0);
rb_define_method(gEntry, "set_text", entry_set_text, 1);
+ rb_define_method(gEntry, "append_text", entry_append_text, 1);
+ rb_define_method(gEntry, "prepend_text", entry_prepend_text, 1);
+ rb_define_method(gEntry, "set_position", entry_set_position, 1);
+ rb_define_method(gEntry, "get_text", entry_get_text, 0);
+ rb_define_method(gEntry, "set_visibility", entry_set_visibility, 1);
rb_define_method(gEntry, "set_editable", entry_set_editable, 1);
+ rb_define_method(gEntry, "set_max_length", entry_set_max_length, 1);
/* EventBox */
rb_define_method(gEventBox, "initialize", eventbox_initialize, 0);
@@ -6785,6 +6840,10 @@ Init_gtk()
rb_define_const(mGdk, "IMAGE_SHARED", INT2FIX(GDK_IMAGE_SHARED));
rb_define_const(mGdk, "IMAGE_FASTEST", INT2FIX(GDK_IMAGE_FASTEST));
+ rb_define_const(mGdk, "CURRENT_TIME", INT2FIX(GDK_CURRENT_TIME));
+ rb_define_const(mGdk, "NONE", INT2FIX(GDK_NONE));
+ rb_define_const(mGdk, "PARENT_RELATIVE", INT2FIX(GDK_PARENT_RELATIVE));
+
argc = RARRAY(rb_argv)->len;
argv = ALLOCA_N(char*,argc+1);
argv[0] = STR2CSTR(rb_argv0);