From: Nigel Wilkinson Date: 2004-06-06T20:47:46+09:00 Subject: Re: Elementary FXDialogBox query --On Sunday, June 06, 2004 03:51:52 +0900 Lyle Johnson wrote: > > On Jun 5, 2004, at 12:41 PM, Nigel Wilkinson wrote: > >> I'm trying to use a dialog box in FXRuby. > > > > Umm, no. You don't call execute() on the dialog box while you're still > constructing it. Try something like this instead: > > class AddItemDialog < FXDialogBox > # Add an accessor so we can get to the text field later > attr_accessor :textField > > def initialize(owner) > ... as before, but... > @textField = FXTextField.new(...) > end > def create > ... as before ... > end > end > > and then invoke it like this: > > theDialog = AddItemDialog.new(someWindow) > if theDialog.execute != 0 > puts theDialog.textField > end > > Hope this helps, > > Lyle > Thanks, I've now got it working. Out of curiosity what class does theDialog.textField return as I have had to use theDialog.textField.to_s to use it as a string. Cheers Nigel