[Fxruby-users] Re: Elementary FXDialogBox query
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@kn...> - 2004-06-05 18:51:48
|
On Jun 5, 2004, at 12:41 PM, Nigel Wilkinson wrote: > I'm trying to use a dialog box in FXRuby. OK. > I have a class set up as follows <snip> > When invoked I get the dialog that closes when either of the buttons > is pressed and return a 1 or a 0 depending on which button is pressed. Yes, looks good. > What I want to do is capture the text in the text field so i tried <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 |