Thread: [Fxruby-users] FXScrollArea
Status: Inactive
Brought to you by:
lyle
From: Fredrik J. <fr...@po...> - 2004-06-01 18:30:52
|
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 |
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 |
From: Fredrik J. <fr...@po...> - 2004-06-01 20:53:06
|
On Tue, Jun 01, 2004 at 03:04:10PM -0500, Steve Tuckner wrote: > Here is a sample of a scroll area that adds and deletes controls. Hope this > helps. It did, without answering my question. :) I thought that I had to use FXScrollArea, and FXScrollWindow was for toplevel windows. But after looking at your code, I realized that it was FXScrollWindow I really wanted. Thanks, //F |
From: RLMuller <RLM...@Co...> - 2004-06-02 02:28:52
|
How'd you get Steve's code to work. I tried it and it barfed on require "myfoxcal". I searched Google for myfoxcal and got nothing. I searched my Ruby 1.8 installation: again, nothing. Regards, Richard ----- Original Message ----- From: "Fredrik Jagenheim" <fr...@po...> To: <fxr...@li...> Sent: Tuesday, June 01, 2004 4:52 PM Subject: Re: [Fxruby-users] FXScrollArea > On Tue, Jun 01, 2004 at 03:04:10PM -0500, Steve Tuckner wrote: > > Here is a sample of a scroll area that adds and deletes controls. Hope this > > helps. > > It did, without answering my question. :) > > I thought that I had to use FXScrollArea, and FXScrollWindow was for > toplevel windows. But after looking at your code, I realized that it > was FXScrollWindow I really wanted. > > Thanks, > //F > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the new InstallShield X. > From Windows to Linux, servers to mobile, InstallShield X is the one > installation-authoring solution that does it all. Learn more and > evaluate today! http://www.installshield.com/Dev2Dev/0504 > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.693 / Virus Database: 454 - Release Date: 5/31/2004 |
From: Fredrik J. <fr...@po...> - 2004-06-02 04:49:07
|
On Tue, Jun 01, 2004 at 10:25:38PM -0400, RLMuller wrote: > How'd you get Steve's code to work. I tried it and it barfed on require > "myfoxcal". > It wasn't so much the running of the code, but seeing that he used FXScrollWindow instead of FXScrollArea. However, just remove the <require 'myfoxcal'> line and the line with <MyDateTime> and it will run. HTH, //F |
From: RLMuller <RLM...@Co...> - 2004-06-02 05:03:41
|
Hi Fredrik, > However, just remove the <require 'myfoxcal'> line and > the line with <MyDateTime> and it will run. > > HTH, It certainly did! Thanks, a lot. Regards, Richard --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.693 / Virus Database: 454 - Release Date: 5/31/2004 |
From: Steve T. <STU...@MU...> - 2004-06-02 13:37:46
|
Oops my mistake, I guess I just posted this too fast..... > -----Original Message----- > From: RLMuller [mailto:RLM...@Co...] > Sent: Tuesday, June 01, 2004 9:26 PM > To: fxr...@li... > Subject: Re: [Fxruby-users] FXScrollArea > > > How'd you get Steve's code to work. I tried it and it barfed > on require > "myfoxcal". > > I searched Google for myfoxcal and got nothing. I searched > my Ruby 1.8 > installation: again, nothing. > > Regards, > Richard > > ----- Original Message ----- > From: "Fredrik Jagenheim" <fr...@po...> > To: <fxr...@li...> > Sent: Tuesday, June 01, 2004 4:52 PM > Subject: Re: [Fxruby-users] FXScrollArea > > > > On Tue, Jun 01, 2004 at 03:04:10PM -0500, Steve Tuckner wrote: > > > Here is a sample of a scroll area that adds and deletes controls. > Hope > this > > > helps. > > > > It did, without answering my question. :) > > > > I thought that I had to use FXScrollArea, and FXScrollWindow was for > > toplevel windows. But after looking at your code, I realized that it > > was FXScrollWindow I really wanted. > > > > Thanks, > > //F > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by the new InstallShield X. > > From Windows to Linux, servers to mobile, InstallShield X is the one > > installation-authoring solution that does it all. Learn more and > > evaluate today! http://www.installshield.com/Dev2Dev/0504 > > _______________________________________________ > > Fxruby-users mailing list > > Fxr...@li... > > https://lists.sourceforge.net/lists/listinfo/fxruby-users > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.693 / Virus Database: 454 - Release Date: 5/31/2004 > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the new InstallShield X. > From Windows to Linux, servers to mobile, InstallShield X is the one > installation-authoring solution that does it all. Learn more and > evaluate today! http://www.installshield.com/Dev2Dev/0504 > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users |