From: Mathieu Bouchard Date: 2002-01-01T09:48:36+09:00 Subject: [ruby-talk:29920] Re: Formatted Text Pane On Sun, 30 Dec 2001, Ron Jeffries wrote: > Chet and I plan to write an editor while not thinking of a pink > elephant, nor of undo, for an article. if you hack the model-view pattern into whatever widget you use, and use a String object for the model, you will not be able to resist "implementing" undo too: require "UndoQueue" model = UndoableString.new but such strings are not observable by default, so you may have to do this too: require 'observer' model.extend Observable def model.put(i,v) super; changed; end def model.put_seq(i,n,v) super; changed; end def model.modify; super; notify_observers; end ________________________________________________________________ Mathieu Bouchard http://hostname.2y.net/~matju