RE: [Fxruby-users] FXScrollArea
Status: Inactive
Brought to you by:
lyle
From: Steve T. <STU...@MU...> - 2004-06-01 20:04:25
|
Here is a sample of a scroll area that adds and deletes controls. Hope this helps. Steve Tuckner -------------------------------------------- require "fox" require "myfoxcal" include Fox class FxTestWindow < FXMainWindow TIMER_INTERVAL = 20 def initialize(app) # Invoke base class initialize first super(app, "FxTest", nil, nil, DECOR_ALL, 0, 0, 600, 600) i = 1 @buttons = [] outsideFrame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y) horzFrame = FXHorizontalFrame.new(outsideFrame, LAYOUT_FILL_X|LAYOUT_FILL_Y) FXButton.new(horzFrame, "Add Control").connect(SEL_COMMAND) do $stdout.print "button pressed\n" $stdout.flush v = FXButton.new(@contentFrame, "Button #{i}") v.create @contentFrame.recalc @buttons.push(v) $stdout.print "v = #{v}\n" $stdout.flush i += 1 @timer = getApp().addTimeout(TIMER_INTERVAL, method(:onTimeout)) end FXButton.new(horzFrame, "Remove Control").connect(SEL_COMMAND) do button = @buttons[0] @buttons = @buttons[1..@buttons.size-1] @contentFrame.removeChild(button) end @scrollFrame = FXScrollWindow.new(outsideFrame, 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) dtzone=MyDateTime.new(@contentFrame, 100,100); end def onTimeout(*args) @scrollFrame.setPosition(0,-(@scrollFrame.contentHeight)) end # Start def create super show(PLACEMENT_SCREEN) end end def runGUI puts "before FXApp.new" # 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 puts "before runGUI" runGUI > -----Original Message----- > From: Fredrik Jagenheim [mailto:fr...@po...] > Sent: Tuesday, June 01, 2004 1:30 PM > To: fxruby > Subject: [Fxruby-users] FXScrollArea > > > Hi, another newbie question... > > How do I use FXScrollArea? > > I had hoped that it would be enough to add a layout manager as a child > to the ScrollArea, but it just draws a white area. How do I add > contents to my area? > > Thanks in advance, > //F > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... > Oracle 10g. > > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users |