From: Takaaki T. <tt...@ja...> - 2001-09-04 15:13:24
|
At Tue, 04 Sep 2001 15:02:19 +0900, > > Interesting approach. Do you think this is better than just > > passing a VALUE and keeping a copy for ourselves? What are > > the advantages? > > If we keep a copy of VALUE, we would have the difficulties of > the object chain and memory management. I'd like to avoid these > difficulties. So I suggested serializing the object. > If we deal with serialized object, we can pay attention to only > string object, and we don't need to consider those difficulties. > This is the advantage. Now I've added some module functions such as Fl::add_fd, Fl::add_timeout, Fl::add_idle and Fl::add_handlers. In this approach, Fltk module has constants FDMap, Callbacks and Handlers to keep Proc objects and user data. # test scripts handler.rb and timeout.rb are also added. In the case of Browser#add, we prepare the instance variable @items which is an Array object and call Fl_Browser::add() with the string and the data, and then we keep added data using @items without copying. I will try to realize this idea, if you don't mind. -- Takaaki Tateishi <tt...@ja...> |