Hi All: I''ve got an fxruby app that creates large dialog forms -- mostly combinations of FXLabel, and FXTextField. It seems that after I''ve displayed some finite number of them, it crashes the app. I''ve duplicated this with a simple app that you press a button to display a new dialog. The demo app doesn''t have the scrolling I''ve added to be able to see all the entries, but seems to demonstrate the same thing happening -- i.e. creating a certain number causes the app to crash (4 for my laptop (windows XP), 6 on citrix session (windows 2000). I''m running from the latest one click installer for windows. Any clues on either what I''m doing wrong or a workaround? Code follows. Thanks in advance Forrest ===================================== #!/usr/bin/env ruby require ''rubygems'' require_gem ''fxruby'' require ''fox12'' include Fox # A little dialog box to use in our tests class FXTestDialog < FXDialogBox def create_entry( parent, number) frame = FXHorizontalFrame.new( parent, LAYOUT_FILL_X) FXLabel.new( frame, "Entry of #{ number} fields:", nil, JUSTIFY_LEFT|LAYOUT_FILL_X) 1.upto( number) { FXTextField.new( frame, 10, nil, 0); } end def initialize(owner) # Invoke base class initialize function first super(owner, "Test of Dialog Box", DECOR_TITLE|DECOR_BORDER) # Bottom buttons buttons = FXHorizontalFrame.new(self, LAYOUT_SIDE_BOTTOM|FRAME_NONE|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH, 0, 0, 0, 0, 40, 40, 20, 20) # Separator FXHorizontalSeparator.new(self, LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|SEPARATOR_GROOVE) # Contents contents = FXVerticalFrame.new(self, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y|PACK_UNIFORM_WIDTH) # simulate large screens of data 1.upto( 60) { |i| create_entry( contents, 30) } # Accept accept = FXButton.new(buttons, "&Accept", nil, self, ID_ACCEPT, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) # Cancel FXButton.new(buttons, "&Cancel", nil, self, ID_CANCEL, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) accept.setDefault accept.setFocus end end # Simulating the kinds of large dialogs in my application class LargeDialogTester < FXMainWindow def initialize(app) # Invoke base class initialize first super(app, "Dialog Test", nil, nil, DECOR_ALL, 0, 0, 400, 200) # Menubar menubar = FXMenuBar.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X) # Separator FXHorizontalSeparator.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|SEPARATOR_GROOVE) # File Menu filemenu = FXMenuPane.new(self) FXMenuCommand.new(filemenu, "&Quit", nil, getApp(), FXApp::ID_QUIT, 0) FXMenuTitle.new(menubar, "&File", nil, filemenu) # Contents contents = FXHorizontalFrame.new(self, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y|PACK_UNIFORM_WIDTH) # Button to pop modal dialog modalButton = FXButton.new(contents, "&New Large Form", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_CENTER_X|LAYOUT_CENTER_Y) modalButton.connect(SEL_COMMAND, method(:onCmdShowDialogModal)) # Build a dialog box @dialog = FXTestDialog.new(self) end # Show a modal dialog def onCmdShowDialogModal(sender, sel, ptr) FXTestDialog.new(self).execute return 1 end # Start def create super show(PLACEMENT_SCREEN) end end def run # Make an application application = FXApp.new("LargeDialog", "FoxTest") # Construct the application''s main window LargeDialogTester.new(application) # Create the application application.create # Run the application application.run end run
Forrest Chang wrote:> Hi All: > > I''ve got an fxruby app that creates large dialog > forms -- mostly combinations of FXLabel, and > FXTextField. It seems that after I''ve displayed some > finite number of them, it crashes the app. I''ve > duplicated this with a simple app that you press a > button to display a new dialog. The demo app doesn''t > have the scrolling I''ve added to be able to see all > the entries, but seems to demonstrate the same thing > happening -- i.e. creating a certain number causes the > app to crash (4 for my laptop (windows XP), 6 on > citrix session (windows 2000). I''m running from the > latest one click installer for windows. > > Any clues on either what I''m doing wrong or a > workaround? Code follows. Thanks in advance > > Forrest > > =====================================> > #!/usr/bin/env ruby > > require ''rubygems'' > require_gem ''fxruby'' > require ''fox12''No crash with fox14 (that''s on linux though, so there may be other variables). -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
En Wed, 16 Nov 2005 21:02:38 -0300, Forrest Chang <fkchang2000 at yahoo.com> escribi?:> > Any clues on either what I''m doing wrong or a > workaround? Code follows. Thanks in advance > > Forrest >Seems to work fine for me. I can get it to display the form in a 1024x800 desktop with no problem. I tested it under fox12 and fox14 on windows. Latest one-click installer (installed only last week). -- Gonzalo Garramu?o
Gonzalo wrote> En Wed, 16 Nov 2005 21:02:38 -0300, Forrest Chang<fkchang2000 at yahoo.com>> escribi?: > > > > > Any clues on either what I''m doing wrong or a > > workaround? Code follows. Thanks in advance > > > > Forrest > > > > Seems to work fine for me. I can get it to displaythe form in a 1024x800> desktop with no problem. I tested it under fox12and fox14 on windows.> Latest one-click installer (installed only lastweek).>Did you try clicking the button repeatedly? I''ve tried on 2 different winxp and 1 windows 2K machine and I crash eventually, some with more clicks and some with less? Thanks Forrest
> From: Joel VanderWerf <vjoel at path.berkeley.edu>> > Forrest Chang wrote: > > Hi All: > > > > I''ve got an fxruby app that creates large dialog > > forms -- mostly combinations of FXLabel, and > > FXTextField. It seems that after I''ve displayed > some > > finite number of them, it crashes the app. I''ve > > duplicated this with a simple app that you press a > > button to display a new dialog. The demo app > doesn''t > > have the scrolling I''ve added to be able to see > all > > the entries, but seems to demonstrate the same > thing > > happening -- i.e. creating a certain number causes > the > > app to crash (4 for my laptop (windows XP), 6 on > > citrix session (windows 2000). I''m running from > the > > latest one click installer for windows. > > > > Any clues on either what I''m doing wrong or a > > workaround? Code follows. Thanks in advance > > > > Forrest > > > > =====================================> > > > #!/usr/bin/env ruby > > > > require ''rubygems'' > > require_gem ''fxruby'' > > require ''fox12'' > > No crash with fox14 (that''s on linux though, so > there may be other > variables). >HI All: I installed the 1.4.3 gem on windows XP, and I get a crash after presenting it 6 times. Any ideas here? I''m gonna have to start to look at porting the whole app to another window toolkit real soon now, since I need to generate more than 5 large forms. THanks in advance. Forrest
Forrest Chang wrote:> HI All: > > I installed the 1.4.3 gem on windows XP, and I get a > crash after presenting it 6 times. Any ideas here? > I''m gonna have to start to look at porting the whole > app to another window toolkit real soon now, since I > need to generate more than 5 large forms.I forget, did someone suggest GC.disable? Doing that before open the forms would help diagnose the problem: if it doesn''t crash any more, there''s probably a dangling pointer somewhere in fxruby. The intermittent behavior of the problem does suggest a memory bug... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Joel Wrote:> I forget, did someone suggest GC.disable? Doing thatbefore open the> forms would help diagnose the problem: if it doesn''tcrash any more,> there''s probably a dangling pointer somewhere infxruby. The> intermittent behavior of the problem does suggest amemory bug... Hi Joel: I put in a GC.disable. Now after 4 clicks, the forms stop appearing. No crash, just no forms. Before, I''d get 4 forms with 4 clicks, click 5 gave no form, click 6 crashed it. So it looks like some problem in fxruby Forrest
On Mon, 28 Nov 2005 12:21:02 -0800 (PST), Forrest Chang <fkchang2000 at yahoo.com> wrote :> I put in a GC.disable. Now after 4 clicks, the > forms stop appearing. No crash, just no forms. > Before, I''d get 4 forms with 4 clicks, click 5 gave no > form, click 6 crashed it. > > So it looks like some problem in fxrubyForrest, Sorry for the delay in responding to this. I have been traveling some (especially last week) and haven''t been able to get to a Windows box to take a look. I can reproduce the problem after five or six displays of the dialog. I have filed a bug report about this and will try to get it corrected ASAP. As a side note, what kind of application is this that is going to require the user to fill in on the order of 1800 text fields in a dialog box? I am concerned that even after I correct the bug that''s causing it to crash, that you''re going to have a unusable application on your hands. -- Lyle
HI Lyle: --- "lyle at knology.net" <lyle at knology.net> wrote:>> Sorry for the delay in responding to this. I have > been traveling some > (especially last week) and haven''t been able to get > to a Windows box to take > a look. I can reproduce the problem after five or > six displays of the > dialog. I have filed a bug report about this and > will try to get it > corrected ASAP. >Thanks, I appreciate it.> As a side note, what kind of application is this > that is going to require > the user to fill in on the order of 1800 text fields > in a dialog box? I am > concerned that even after I correct the bug that''s > causing it to crash, that > you''re going to have a unusable application on your > hands. >It ultimately to populate parameters for a substantial simulation model. THere are various "sites" which have subsystems that need modeling. Only one of these subsystems has the huge number of parameters which produced this problem. FOr the most part, these parameters are already in place, and they''re just tweaking the values. I have a copy function that allows them to copy the sets across sites. FOrrest
Forrest Chang wrote: ...> It ultimately to populate parameters for a > substantial simulation model. THere are various > "sites" which have subsystems that need modeling. > Only one of these subsystems has the huge number of > parameters which produced this problem. FOr the most > part, these parameters are already in place, and > they''re just tweaking the values. I have a copy > function that allows them to copy the sets across > sites.What about using a FXTable? Not as pretty, but 1800 text fields ain''t exactly pretty either... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
HI Joel: --- Joel VanderWerf <vjoel at path.berkeley.edu> wrote:> > What about using a FXTable? Not as pretty, but 1800 > text fields ain''t > exactly pretty either... >Hmm, I could consider this, what I basically do is traverse these arbitrarily nested data structures and map it into titles, entries, and sub buttons to open up sub structures all on the fly (the data structure definititions are ever evolving). That being said, I don''t off the bat have a good idea of how to map that to a table instead of just opening frames, and plopping entries into them, and have it look somewhat reasonable. I''m open to ideas though. FOrrest