- rb_funcall ((VALUE) data, rb_intern ("call"), 1,
- rb_str_new2 (part));
+ VALUE self = (VALUE) data, part, name;
+
+ GET_OBJ (self, RbEdje, e);
+
+ name = rb_str_new2 (part_name);
+
+ if (NIL_P (part = rb_hash_aref (e->parts, name))) {
+ part = TO_PART (self, name);
+ rb_hash_aset (e->parts, name, part);
+ }
+
+ rb_funcall (e->on_text_changed_cb,
+ rb_intern ("call"), 1, part);