[fxruby-users] help, message passing

boxofsoxx-goognews@yahoo.com boxofsoxx-goognews at yahoo.com
Thu Jan 19 20:09:52 EST 2006


        ----- Original Message ----- 

    From: "Joel VanderWerf" <vjoel at path.berkeley.edu>
  To: <fxruby-users at rubyforge.org>
  Sent: Tuesday, January 17, 2006 10:52 PM
  Subject: Re: [fxruby-users] help, message passing

  

> boxofsoxx-goognews at yahoo.com wrote:
>> What is the correct way to pass messages between windows. I am trying to create
>> an edit dialog that allows you to edit and save a text field. The dialog called
>> FXEditDialog is inherited from FXDialogBox, and has an FXText field, and three
>> buttons, save cancel and OK. I don't know how to pass the message from the
>> buttons back to the main window so that I can update the the field in the main
>> window. I looked through the documentation and couldn't find any examples. Any
>> help will be greatly appreciated.
> 
> Can you just call #connect on each button, and give it a code block that
> sets the text of the field in the main window?
> 
> -- 
>      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
> _______________________________________________
     
  Thanks for the response.
   
  This might work, but I am a bit confused as to how to pull it off. The edit window has the buttons and the new text. I am unsure how to use the button connected routine to update the main windows copy of the text. It seems like the child window will need to have access to the main windows variables, or the main window has to connect to the child window's buttons. Does the variable scope allow this?
   
  If this is the best route, than I can fuddle with it until I figure something out. It seems like there should be an easier way to do this. A lot of FX dialogs pass messages back to the main window, but these are all written in C. I haven't seen anyone construct a dialog strictly in FXRuby, but it seems like it should possible.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060119/1dcac36d/attachment.htm


More information about the fxruby-users mailing list