Re: [Fxruby-users] Message Identifiers, Types, etc again.
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <jl...@cf...> - 2003-06-13 16:20:05
|
Hugh Sasse Staff Elec Eng wrote: > So, either I am right about this, and the api docs need fixing, or I > am wrong about this, and http://www.fox-toolkit.org/messages.html > needs fixing because it says: > <quote> > The approach taken by FOX is a Target/Message System. Each Widget > sends its message to a certain object called the target. As there > may be multiple Widgets sending messages to one specific target, a > message id is used to tell them apart. > > Moreover, a single Widget may be able to send several kinds of > messages; this problem is solved by typing the messages by a > message type. Using the message type and message id, the source and > type of a GUI event or action can be uniquely identified. > </quote> > > Or, is there in fact a third way to understand this, and reconcile > both these documents? I agree that the documentation on the FOX web site doesn't tell the whole story about how message identifiers are used, and instead focuses on one particular use. Obviously, if the *only* purpose of the message identifier were to distinguish between senders, you could arguably just hang on to a reference to the sender object(s) and compare them when you get a message: @button1 = FXButton.new(...) @button2 = FXButton.new(...) ... def onMessageReceived(sender, sel, ptr) if sender == @button1 # do something elif sender == @button2 # do something else end return 1 end But as I (hopefully) explained in my previous response, that in fact isn't the whole story when it comes to message identifiers ;) Hope this helps, Lyle |