[Fxruby-users] Re: Elementary FXDialogBox query
Status: Inactive
Brought to you by:
lyle
From: Nigel W. <ni...@wa...> - 2004-06-06 11:47:51
|
--On Sunday, June 06, 2004 03:51:52 +0900 Lyle Johnson <ly...@kn...> wrote: > > On Jun 5, 2004, at 12:41 PM, Nigel Wilkinson wrote: > >> I'm trying to use a dialog box in FXRuby. > > <snip> > > 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 |