I''m trying to replace the contents of a FXTreeList and can''t get it to display. If I call fillList from the instillation method, the list is displayed correctly, but calling it later will not display. Also I''ve have a dialog displayed by Msg_Box(). On the first call, it displays correctly but on subsequent calls it never displays. To call fillList I use: filelistproc = proc { filelist } FXButton.new(mat, "File List", nil, nil, 0, FRAME_RAISED|FRAME_THICK|LAYOUT_FILL_X) do |filelistbutton| filelistbutton.connect(SEL_COMMAND,filelistproc) end This will destroy the old list, but not display the new list. I can, however, crawl the tree with: @group1.children.each {|c| print "Group1 Child ",c.to_s,"\n" c.show c.each {|d| print " D ",d.class,"->",d.to_s,"\n" d.each {|e| print " E ",e.class," ",e.to_s,"\n" #print " E ",e.class,"\n" } #d.children.each{|dc| # print " D child ", dc.to_s,"\n"} } } and see that the new tree exists and is populated. Skipping the .removeChild leaves the old treelist displayed in 1/2 of the window, and add a new FXtreeList to the child list, but the second list does not display. What do i need for do to get the tree list to display when it''s replaced? Harold Worby ###################### fillList def fillList @group1.children.each {|c| print "Remove Child ",c.to_s,"\n" @group1.removeChild(c) } $tree= FXTreeList.new(@group1, 0, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_TOP|LAYOUT_RIGHT|TREELIST_SHOWS_LIN ES| TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES|TREELIST_EXTENDEDSELECT) topmost = $tree.addItemLast(nil, $dbname, folder_open, folder_closed) s=File.mtime($dbname).to_s + " : " + File.size($dbname).to_s + " Bytes " topmost = $tree.addItemLast(topmost, s + " Bytes", doc,doc) sql = "select * from archive order by name;" #print sql,"\n" rows = $db.query( sql ) lastname="" branch=topmost rows.each { |row| if row[0] != lastname branch = $tree.addItemLast(topmost, row[0].to_s, folder_open, folder_closed) item = $tree.addItemLast(branch, row[1].to_s, doc, iundo) item.data=rows else branch0 = $tree.addItemLast(branch, row[0].to_s, folder_open, folder_closed) item = $tree.addItemLast(branch0, row[1].to_s, doc, iredo) item.data=rows end lastname= row[0] print "add item ",item.text,"\n" } rows.close end ###################################### Msg_Box def Msg_Box(sentences) w = 350 h = 250 centerX = self.x + (self.width/2) centerY = self.y + (self.height/2) originX = centerX-(w/2) originY = centerY-(h/2) dialog = FXDialogBox.new($application,"Message Box",DECOR_ALL,originX,originY,w,h) outFrame FXVerticalFrame.new(dialog,LAYOUT_FILL_X|LAYOUT_FILL_Y,0,0,0,0) topFrame FXHorizontalFrame.new(outFrame,LAYOUT_FILL_X|LAYOUT_FILL_Y,0,0,w,h) bottomFrame = FXHorizontalFrame.new(outFrame,LAYOUT_CENTER_X) list = FXList.new(topFrame,1,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y) buttonFXButton.new(bottomFrame,"OK",nil,dialog,FXDialogBox::ID_ACCEPT) sentences.each { | s | list.appendItem(s) } dialog.show end
On Wed, 16 Mar 2005 09:44:18 -0600, "Harold Worby" <H.Worby@Kinsey.Com> wrote :> > I''m trying to replace the contents of a FXTreeList and can''t get it to > display. > If I call fillList from the instillation method, the list is displayed > correctly, but calling it later will not display.I think you just need to add a call to create() for the tree items that are created after the program''s up and running, e.g. item = $tree.addItemLast(...) item.create For more info, please see this question from the FOX FAQ: http://www.fox-toolkit.com/faq.html#CREATELATER> Also I''ve have a dialog displayed by Msg_Box(). On the first call, it > displays correctly but on subsequent calls it never displays.This may be the same problem (although I''m not sure). See what changes (if anything) if you add a call to dialog.create right before the call to dialog.show.
Calling either dialog.create or tree.create both cause Segmentation faults. splitter.rb:292: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [i386-mswin32] Adding item.create had no effect. Harold Worby -----Original Message----- From: lyle@knology.net [mailto:lyle@knology.net] Sent: Wednesday, March 16, 2005 9:53 AM To: Harold Worby Cc: fxruby-users@rubyforge.org Subject: Re: [fxruby-users] FX GUI objects won''t display On Wed, 16 Mar 2005 09:44:18 -0600, "Harold Worby" <H.Worby@Kinsey.Com> wrote :> > I''m trying to replace the contents of a FXTreeList and can''t get it to > display. > If I call fillList from the instillation method, the list is displayed > correctly, but calling it later will not display.I think you just need to add a call to create() for the tree items that are created after the program''s up and running, e.g. item = $tree.addItemLast(...) item.create For more info, please see this question from the FOX FAQ: http://www.fox-toolkit.com/faq.html#CREATELATER> Also I''ve have a dialog displayed by Msg_Box(). On the first call, it > displays correctly but on subsequent calls it never displays.This may be the same problem (although I''m not sure). See what changes (if anything) if you add a call to dialog.create right before the call to dialog.show.
On Mar 17, 2005, at 1:38 PM, Harold Worby wrote:> Calling either dialog.create or tree.create both cause Segmentation > faults. > splitter.rb:292: [BUG] Segmentation fault > ruby 1.8.2 (2004-12-25) [i386-mswin32] > > Adding item.create had no effect.OK. I saw the code excerpts in your previous e-mail and was just hazarding a guess based on those. Can you send me the full program (off list) so that I can try to debug what''s happening? Also, do you know which version of FXRuby you''re running? If you''re just using the version of FXRuby that came bundled with the One-Click Installer for Ruby 1.8.2, it''s a few releases behind now and it''s possible that we''ve made some bug corrections in the meantime that would address this problem. If I recall correctly, the One-Click Installer for Ruby 1.8.2 came with FXRuby 1.2.2, and we''re up to FXRuby 1.2.5 as of a few weeks ago. You can check to see which version of FXRuby is installed with this command: ruby -rfox12 -e ''puts Fox.fxrubyversion'' Thanks, Lyle
I resolved the issue withe object not displaying. I''ve discovered you can not call widgit.create durring the application initialize routine, But when creating a widjit later you HAVE to call widgit.create. That''s where I was stuck. Here''s my ruby version. Guess I neet to update! C:\ruby\me>..\bin\ruby -rfox -e ''puts Fox.fxrubyversion'' 1.0.28 but by directory is named C:\ruby\lib\ruby\gems\1.8\gemsfxruby-1.2.2-mswin32 what gives? -----Original Message----- From: fxruby-users-bounces@rubyforge.org [mailto:fxruby-users-bounces@rubyforge.org]On Behalf Of Lyle Johnson Sent: Saturday, March 19, 2005 7:20 AM To: Harold Worby Cc: fxruby-users@rubyforge.org Subject: Re: [fxruby-users] FX GUI objects won''t display On Mar 17, 2005, at 1:38 PM, Harold Worby wrote:> Calling either dialog.create or tree.create both cause Segmentation > faults. > splitter.rb:292: [BUG] Segmentation fault > ruby 1.8.2 (2004-12-25) [i386-mswin32] > > Adding item.create had no effect.OK. I saw the code excerpts in your previous e-mail and was just hazarding a guess based on those. Can you send me the full program (off list) so that I can try to debug what''s happening? Also, do you know which version of FXRuby you''re running? If you''re just using the version of FXRuby that came bundled with the One-Click Installer for Ruby 1.8.2, it''s a few releases behind now and it''s possible that we''ve made some bug corrections in the meantime that would address this problem. If I recall correctly, the One-Click Installer for Ruby 1.8.2 came with FXRuby 1.2.2, and we''re up to FXRuby 1.2.5 as of a few weeks ago. You can check to see which version of FXRuby is installed with this command: ruby -rfox12 -e ''puts Fox.fxrubyversion'' Thanks, Lyle _______________________________________________ fxruby-users mailing list fxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users
On Mar 20, 2005, at 9:09 PM, Harold Worby wrote:> Here''s my ruby version. Guess I neet to update! > > C:\ruby\me>..\bin\ruby -rfox -e ''puts Fox.fxrubyversion'' > 1.0.28 > > but by directory is named > C:\ruby\lib\ruby\gems\1.8\gemsfxruby-1.2.2-mswin32 > what gives?It looks like you have both FXRuby versions 1.0.28 and 1.2.2 installed. That''s OK; there''s no conflict as far as Ruby''s concerned, and it might prove useful to have both versions around in case you come across some older FXRuby-based application that requires FXRuby version 1.0.x instead of 1.2.x. As you noted, the way to determine your installed FXRuby 1.0 version (if any) is to require the ''fox'' extension, e.g. ruby -rfox -e ''puts Fox.fxrubyversion'' while the way to determine your installed FXRuby 1.2 version (if any) is to require ''fox12'', e.g. ruby -rfox12 -e ''puts Fox.fxrubyversion'' Hope this helps, Lyle