mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fujioto's patch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a66aaeb22a
commit
4cee024801
1 changed files with 59 additions and 0 deletions
|
@ -4581,6 +4581,47 @@ entry_set_text(self, text)
|
|||
return self;
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -4589,6 +4630,14 @@ entry_set_editable(self, editable)
|
|||
return self;
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue