[fxruby-users] Ruby Fox newbie query
seamus_0 at yahoo.co.uk
Wed Aug 22 08:01:54 EDT 2007
I'm trying to get to grips with a Ruby GUI and have plunked for Fox and/or FoxGUIb. I'm having problems at the moment trying to do something simple which I can't find in the samples or tutorials how to do. Basically, in my main window, its composed of 2 vertical frames. There is a menu at the top for all the options. All Im trying to do is display text inputs fields in the left vertical frame.This is for user input, to run specific apps. What text fields shown are dependant on the menu option chosen. The right frame is a response screen.Below is some snippets:-
..... My left vertical frame for data input.....
@group1 = FXGroupBox.new(contents, "Information",
:opts => GROUPBOX_TITLE_LEFT|FRAME_RIDGE|LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT,
:width => 200, :height => 400)
...... My menu option.......
mymenu = FXMenuPane.new(self)
FXMenuTitle.new(menubar, "&Target", nil, mymenu, LAYOUT_LEFT)
details=FXMenuCommand.new(mymenu, "&Details").connect(SEL_COMMAND) do
FXTextField.new(@group1, 10, :opts => FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X)
What I thought should have happend in the above snippet was that on selecting the 'mymenu' option, a new text field would be entered into the vertical frame '@group1'. However this doesnt happen. Nothing happens.
Ideally, I'd like the command on selecting the menu option to go to a function that changes the look of the vertical frame i.e, showing different text fields dependant on the menu chosen. Im sure its a syntex issue.
Can you point me to an example on how this can be done?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fxruby-users