
Some parts of this message have been removed.
Learn more about Nabble's
security policy.
Hi everybody,
I just started working with FXRuby and I maybe somebody can help me with a problem.
Just for fun, I wrote a quiz game in Ruby, but up to now it is only running in a DOS window.
To get it a little bit more attractive, I wanted FXRuby to present the questions in a window
and open a field for the user to type in the answer. The answer should then be sent to the main program
as a string variable "response".
I've tried it like this, following the "hello"-example that comes with FX Ruby...
application = FXApp.new("Hello", "FoxTest")
main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL)
FXButton.new(main, frage, nil, application, FXApp::ID_QUIT)
FXButton.new(main, p1, nil, application, FXApp::ID_QUIT)
FXButton.new(main, p2, nil, application, FXApp::ID_QUIT)
FXButton.new(main, p3, nil, application, FXApp::ID_QUIT)
FXButton.new(main, p4, nil, application, FXApp::ID_QUIT)
application.create()
main.show(PLACEMENT_SCREEN)
application.run()
# p1,p2,p3 and p4 are the variables that contain the answer possibilties
# frage is the question
Now, everything is displayed but I don't know how to give the user the chance to type the answer into a text field
and then this should be sent to the main program... any idea?
Ah, and the program works with a while-loop and after the first run I get an error:
"attempted to create more than one FXApp instance (RunTimeError)"
Does anyone know what s the problem here?
Thank you for all answers!
Posteingang immer voll? Der erste Speicher, der mitwächst:
Unbegrenzter Speicher bei Windows Live Hotmail!
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users