From: Holden Glova Date: 2001-07-12T16:57:41+09:00 Subject: [ruby-talk:17702] Re: FXDocument -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 12 Jul 2001 02:49, Lyle Johnson wrote: > > I've been experimenting with FXRuby for a wee while now and have > > struck the need to be able to have a MVC type of paradigm for an > > FXText object. While trying to satisfy my need, I came across the > > abstract class FXDocument which sounds like it is what I need. > > What I don't understand is how to connect it to the FXText > > object. Is this possible or is FXDocument for something else? > > What exactly is the deal with FXDocument? > > The deal with FXDocument is that it *can* be used as the base class > for your Document (or Model) class in an MVC sense, although it's > definitely not a requirement. Its specific original intent was for > use with the MDI classes in FOX. When an FXMDIChild window receives > a message indicating that it has been selected it forwards that > information to its message target -- a different object, which can > act as the "document" in a Document-View pattern. When that > document object (presumably one of many) gets notification that it > has been selected, it could in turn update the program state, other > widgets in the GUI, etc. (i.e. standard MVC stuff). > > I'm not sure that this will help you with an FXText widget; you'll > probably just want to roll your own Document class and subclass it > directly from FXObject so that it can handle messages. You can then > make this Document object the message target for the FXText widget; > that way, e.g., when someone deletes text from the FXText widget, a > message will get fired off to your Document object and you can > react appropriately. > > Hope this helps, Thanks Lyle, this helps clarify what I need to do :) - -- Signed, Holden Glova -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7TVeH+mF116Lw2cQRAkkhAKCChX0x/wNxc2GTElub96iVQD9TTQCfXTIi k5VMSotNbCSB9Yi9iZvO4Ig= =h5Qw -----END PGP SIGNATURE-----