From: Yasushi Shoji <yashi / yashi.com>
Subject: [ruby-ext:00626] Gtk::Paned
Date: Tue, 30 Nov 1999 10:05:46 -0500

> やすしです。
> 
> Gtk::Paned#{handle,gutter}_sizeが、古い名前らしいので(RDP参照) 新しい名
> 前の Gtk::Paned#set_{handle,gutter}_sizeにしてみました。
> 
> あと handle_size=や child1_resize? の方が、Rubyっぽいかな〜と思って 
> aliasにしてあります。
> 
> 気に入らなかったら、すててください。

って、付けわすれ‥‥。

[ruby-ext: 00625]で、ごとけんさんが testしてくれたの gint16の所は
NUM2INTから FIX2INTにしてあります。
--
          yashi

--- rbgtkcontainer.c 1999/11/29 13:57:57 1.1.1.2 +++ rbgtkcontainer.c 1999/11/30 15:14:40 @@ -655,15 +664,23 @@ paned_handle_size(self, size) VALUE self, size; { - gtk_paned_handle_size(GTK_PANED(get_widget(self)), NUM2INT(size)); + gtk_paned_handle_size(GTK_PANED(get_widget(self)), FIX2INT(size)); return self; } static VALUE paned_gutter_size(self, size) VALUE self, size; +{ + gtk_paned_gutter_size(GTK_PANED(get_widget(self)), FIX2INT(size)); + return self; +} + +static VALUE +paned_set_position(self, pos) + VALUE self, pos; { - gtk_paned_gutter_size(GTK_PANED(get_widget(self)), NUM2INT(size)); + gtk_paned_set_position(GTK_PANED(get_widget(self)), FIX2INT(pos)); return self; } @@ -719,14 +736,19 @@ rb_define_method(gPaned, "add2", paned_add2, 1); rb_define_method(gPaned, "pack1", paned_pack1, 3); rb_define_method(gPaned, "pack2", paned_pack2, 3); - rb_define_method(gPaned, "handle_size", paned_handle_size, 1); - rb_define_method(gPaned, "gutter_size", paned_gutter_size, 1); + rb_define_method(gPaned, "set_handle_size", paned_handle_size, 1); + rb_define_method(gPaned, "set_gutter_size", paned_gutter_size, 1); + rb_define_method(gPaned, "set_position", paned_set_position, 1); rb_define_method(gPaned, "child1", paned_child1, 0); rb_define_method(gPaned, "child2", paned_child2, 0); - rb_define_method(gPaned, "child1_resize", paned_child1_resize, 0); - rb_define_method(gPaned, "child1_shrink", paned_child1_shrink, 0); - rb_define_method(gPaned, "child2_resize", paned_child2_resize, 0); - rb_define_method(gPaned, "child2_shrink", paned_child2_shrink, 0); + rb_define_method(gPaned, "child1_resize?", paned_child1_resize, 0); + rb_define_method(gPaned, "child1_shrink?", paned_child1_shrink, 0); + rb_define_method(gPaned, "child2_resize?", paned_child2_resize, 0); + rb_define_method(gPaned, "child2_shrink?", paned_child2_shrink, 0); + + rb_define_alias(gPaned, "handle_size=", "set_handle_size"); + rb_define_alias(gPaned, "gutter_size=", "set_gutter_size"); + rb_define_alias(gPaned, "position=", "set_position"); } /*