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

Philippe Lang philippe.lang at attiksystem.ch
Tue Oct 10 12:17:48 EDT 2006


Jeroen van der Zijp wrote:
> On Saturday 07 October 2006 07:15, Philippe Lang wrote:
>> Hi,
>> 
>> I have read that message handlers can return a value,
> either true or false, depending on if the handler actually
> did something, or not. In the latter case, the message is
> forwarded to the default message handler.
>> 
>> I have tried this, and found something strange: in this code,
>> decommenting: 
>> 
>>     @data_widget.connect(SEL_KEYPRESS) do |sender, selector, data|  
>>         puts d.code false
>>     end
>> 
>> ... breaks the update of the textfield. The handler returns
> false in every case, it should have no effect at all, no?
>> 
>> I'm I missing something maybe?
> 
> Do the same for the SEL_KEYRELEASE and it will work....

Hi,

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...

---------------
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/20061010/b4c40f4c/attachment-0001.bin 


More information about the fxruby-users mailing list