[fxruby-users] Data Targets and message handlers [was: Defaultdouble-click in FXTable?]

Philippe Lang philippe.lang at attiksystem.ch
Thu Oct 12 02:07:03 EDT 2006

fxruby-users-bounces at rubyforge.org wrote:
> On Oct 10, 2006, at 11:17 AM, Philippe Lang wrote:
>> I'm convinced it is not the problem: under FXRuby, message handling
>> has been implemented using "PseudoTargets", in order to simplify the
>> way you write message handlers. Connecting a handler to a widget
>> changes its target (the new target is the pseudo target!).
>> So if you previously set the target of widget to an FXDataTarget, the
>> link gets lost after you connect the handler.
>> This makes FXDataTarget objects pretty useless under FXRuby...
> Unless I'm misunderstanding what it is that you're trying to
> do, this has nothing to do with FXRuby. A FOX widget (such a
> FXTextField) can only have a single message target. That
> target object can be an FXDataTarget, or it can be some other
> object that responds to messages, but there can only be one.
> You can't (directly) connect an FXTextField to, say, both an
> FXDataTarget and some other object that handles SEL_KEYPRESS
> and SEL_KEYRELEASE messages sent from the FXTextField.


Unless I'M misunderstanding something (probably!), I see things this way:

1) An object, let's say an FXTextField, can have a target, for example an FXDataTarget. This is fine. Something happens in the widget, and the target is called.

2) This same FXTextField should also be able to process messages in the same time, when it is the target of another object. The solution is to use the "connect" method, and add the handler to the object.

Unfortunately, under FXRuby, both options are not possible in the same time: connect changes the target of the FXTextField, and sets it to a new object, called "PseudoTarget". This is a pure FXRuby thing, as far as I know.

So I was wondering if we could not get rid of this Pseudo Target, so an object can independently HAVE a target, and BE a target (process messages). This is possible under Fox C++, right?

Philippe Lang
Attik System

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3125 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20061012/d2615618/attachment.bin 

More information about the fxruby-users mailing list