[Fxruby-users] (no subject)
Status: Inactive
Brought to you by:
lyle
|
From: Steve T. <STU...@MU...> - 2003-06-24 18:23:21
|
Hello all,
I am trying to do something simple (I think) but it is not working for
me. I when the button is pressed to put another button below the first
button and so on until the entire frame scrolls. Below is my code.
Thanks for the help in advance
Steve Tuckner
------------------------------------------------------------------------
--------------------
require "fox"
include Fox
class FxTestWindow < FXMainWindow
def initialize(app)
# Invoke base class initialize first
super(app, "FxTest", nil, nil, DECOR_ALL, 0, 0, 600, 600)
scrollFrame = FXScrollWindow.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y)
@contentFrame = FXVerticalFrame.new(scrollFrame,
LAYOUT_FILL_X|LAYOUT_FILL_Y)
FXText.new(@contentFrame, nil, 0, LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT,
0, 0, 200, 100)
i = 1
FXButton.new(@contentFrame, "Add Control").connect(SEL_COMMAND) do
$stdout.print "button pressed\n"
$stdout.flush
v = FXButton.new(@contentFrame, "Button #{i}")
$stdout.print "v = #{v}\n"
$stdout.flush
i += 1
end
end
# Start
def create
super
show(PLACEMENT_SCREEN)
end
end
def runGUI
# Make an application
$application = FXApp.new("Dialog", "FxWorld")
# Open the display
$application.init(ARGV)
# Construct the application's main window
FxTestWindow.new($application)
# Create the application
$application.create
# Run the application
$application.run
end
runGUI
|