From natarajnarayan at vaaraahi.com Thu Sep 4 04:06:08 2008 From: natarajnarayan at vaaraahi.com (natarajnarayan at vaaraahi.com) Date: Thu, 04 Sep 2008 13:36:08 +0530 Subject: [fxruby-users] Multiple Main window Message-ID: <20080904133608.sftevofgwgcggc00@webmail.vaaraahi.com> Hi friends I am from Delphi/Lazarus world. Trying my hands on fxruby. I have made a FXMainWindow for user verification. Once the user is verified and clicks Button (OK) i need to close the current FXMain window and Start a new Main window. Presently, I am modifying the pig.rb example to suit my needs. I use dbd-mysql to connect to remote database. The password verification part works fine. Is it possible to kill the existing FXMain form and create a new one dynamically? Or can I remove all the widgets in the current form and add next set of widgets dynamically ? Please suggest to me the best methods. regards Nataraj ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From v.konrad at lse.ac.uk Thu Sep 4 05:09:19 2008 From: v.konrad at lse.ac.uk (Vladimir Konrad) Date: Thu, 4 Sep 2008 10:09:19 +0100 Subject: [fxruby-users] Multiple Main window In-Reply-To: <20080904133608.sftevofgwgcggc00@webmail.vaaraahi.com> References: <20080904133608.sftevofgwgcggc00@webmail.vaaraahi.com> Message-ID: <20080904100919.4d42bb38@107.201.dyn.lse.ac.uk> > Hi friends > > I am from Delphi/Lazarus world. Trying my hands on fxruby. > > I have made a FXMainWindow for user verification. Once the user is > verified and clicks Button (OK) i need to close the current FXMain > window and Start a new Main window. So it is a some form of log-in? I have done something like this a while back, I used a dialog box for user authentication and let access to the main window when it succeeded... I can send you working example when I get back home today (no access there from here)... Vlad Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm From qamason at gmail.com Thu Sep 4 12:36:06 2008 From: qamason at gmail.com (Quentin Mason) Date: Thu, 4 Sep 2008 11:36:06 -0500 Subject: [fxruby-users] Multiple Main window In-Reply-To: <20080904100919.4d42bb38@107.201.dyn.lse.ac.uk> References: <20080904133608.sftevofgwgcggc00@webmail.vaaraahi.com> <20080904100919.4d42bb38@107.201.dyn.lse.ac.uk> Message-ID: <1913cfdf0809040936t6125a5c3x540fcc511413e894@mail.gmail.com> You can hide the main window, after opening the new one. This way if you ever want to pull it up again, you will be able to. On Thu, Sep 4, 2008 at 4:09 AM, Vladimir Konrad wrote: > > Hi friends > > > > I am from Delphi/Lazarus world. Trying my hands on fxruby. > > > > I have made a FXMainWindow for user verification. Once the user is > > verified and clicks Button (OK) i need to close the current FXMain > > window and Start a new Main window. > > So it is a some form of log-in? > > I have done something like this a while back, I used a dialog box for user > authentication and > let access to the main window when it succeeded... > > I can send you working example when I get back home today (no access there > from here)... > > Vlad > > Please access the attached hyperlink for an important electronic > communications disclaimer: > http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.konrad at lse.ac.uk Thu Sep 4 14:27:49 2008 From: v.konrad at lse.ac.uk (Vladimir Konrad) Date: Thu, 4 Sep 2008 19:27:49 +0100 Subject: [fxruby-users] Multiple Main window In-Reply-To: <20080904133608.sftevofgwgcggc00@webmail.vaaraahi.com> References: <20080904133608.sftevofgwgcggc00@webmail.vaaraahi.com> Message-ID: <20080904192749.64171629@107.201.dyn.lse.ac.uk> One possible implementation of log-in attached. Hope this helps, Vlad Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: login-example.rb Type: application/x-ruby Size: 4428 bytes Desc: not available URL: From lyle at lylejohnson.name Fri Sep 5 18:08:12 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Fri, 5 Sep 2008 17:08:12 -0500 Subject: [fxruby-users] closing DialogBox in FXRuby In-Reply-To: <015d131c-1296-4997-b3c3-f7c26558e473@k7g2000hsd.googlegroups.com> References: <015d131c-1296-4997-b3c3-f7c26558e473@k7g2000hsd.googlegroups.com> Message-ID: <57cf8f720809051508x4f2fdb6ek740959140203c5fa@mail.gmail.com> On Fri, Sep 5, 2008 at 1:24 PM, MAwiniarski wrote: > I've got opened MainWindow and DialogBox in which I want to manipulate > some data, using entry form and methods. > > How to close DialogBox to return to MainWindow not using standard "OK" > "Cancel" buttons ? Something like this should work: getApp().stopModal(dialogBox, true) dialogBox.hide Hope this helps, Lyle From dragoncity at aanet.com.au Sat Sep 6 03:14:10 2008 From: dragoncity at aanet.com.au (dragoncity) Date: Sat, 6 Sep 2008 00:14:10 -0700 (PDT) Subject: [fxruby-users] Tab control using FXRuby Message-ID: <19343124.post@talk.nabble.com> In the sample program below I have a form of 6 text fields, in a scrolling window, followed by a row of function buttons. Problems: 1) For data entry purposes I'd like the function buttons NOT to be entered by pressing Tab keys, and retain their 'clickability', but when the user Tab's out of the last scrolling field (postcode) to have the form scroll to the top and the cursor positioned in the first field to accept a new set of data. The scrolling works, but the focus moves to the first Button and not the field even tho I have a explicit setFocus. I dont want the Buttons 'hidden' just not tabbable -- is this possible? 2) if no data is entered into a field prior to a Tab press, the scroller does not scroll the form at all, the cursor moves to next field OK, but I never get to see the off scrollwindow fields. If I enter some data, then Tab, the scroller functions and the next fields are displayed. Thanks ============================================== #!/usr/bin/env ruby # zestaddr2.rb # Generated by RubyFXGen.rb Ver 0.9a on :Mon Sep 01 17:20:31 +1000 2008 # plus added code to setup scroller require 'fox16' include Fox class MainWindow < FXMainWindow def initialize(app) super( app, 'Zest Address Entry') self.width = 422 self.height = 250 amain= FXVerticalFrame.new(self,LAYOUT_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) main = FXScrollWindow.new(amain, LAYOUT_FILL_X|LAYOUT_FILL_Y) addr= FXMatrix.new(main, 2,MATRIX_BY_COLUMNS|LAYOUT_CENTER_X) # addr FXLabel.new(addr, "First Name" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld1= FXDataTarget.new("") fld1a=FXTextField.new(addr,20, fld1, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld1a.connect(SEL_COMMAND) do puts "fld1 contains #{fld1.value}" main.setPosition(-10, -10) end FXLabel.new(addr, "Surname" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld2= FXDataTarget.new("") FXTextField.new(addr,20, fld2, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld2.connect(SEL_COMMAND) do puts "fld2 contains #{fld2.value}" main.setPosition(-20, -20) end FXLabel.new(addr, "Company Name" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld3= FXDataTarget.new("") FXTextField.new(addr,20, fld3, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld3.connect(SEL_COMMAND) do puts "fld3 contains #{fld3.value}" main.setPosition(-30, -30) end FXLabel.new(addr, "Addr1" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr1= FXDataTarget.new("") FXTextField.new(addr,20, addr1, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr1.connect(SEL_COMMAND) do puts "addr1 contains #{addr1.value}" main.setPosition(-40, -40) end FXLabel.new(addr, "Addr2" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr2= FXDataTarget.new("") FXTextField.new(addr,20, addr2, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr2.connect(SEL_COMMAND) do puts "addr2 contains #{addr2.value}" main.setPosition(-50, -50) end FXLabel.new(addr, "Addr3" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr3= FXDataTarget.new("") FXTextField.new(addr,20, addr3, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr3.connect(SEL_COMMAND) do puts "addr3 contains #{addr3.value}" main.setPosition(-70, -70) end FXLabel.new(addr, "PostCode" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) postcode= FXDataTarget.new("") FXTextField.new(addr,20, postcode, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) postcode.connect(SEL_COMMAND) do puts "postcode contains #{postcode.value}" main.setPosition(-0, -0) ## scroll back to first field ( it does ) fld1a.setFocus ## focus on first field ( it does NOT ! -> first BUTTON "New" ) end btns= FXHorizontalFrame.new(amain, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN) # btns new= FXButton.new(btns, "New", :opts => LAYOUT_FILL_X| BUTTON_NORMAL) new.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## end # new clear= FXButton.new(btns,"Clear", :opts => LAYOUT_FILL_X|BUTTON_NORMAL) clear.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## end # clear load= FXButton.new(btns,"Load", :opts=> LAYOUT_FILL_X|BUTTON_NORMAL) load.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## end # load save= FXButton.new(btns,"Save", :opts=>LAYOUT_FILL_X|BUTTON_NORMAL) save.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## end # save quit= FXButton.new(btns,"Quit", :opts=>LAYOUT_FILL_X|BUTTON_NORMAL) quit.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## exit() end # quit # set initial field address fld1a.setFocus end # def initilize def create super show(PLACEMENT_SCREEN) end # create end # class MainWindow # ============= main prog ============ # Construct an application theApp = FXApp.new('Smithy','Max') # Construct the main window theApp.normalFont = FXFont.new(theApp,'Adobe Courier',12,FONTWEIGHT_BOLD) # define default display FONT for this application MainWindow.new(theApp) # Create and show the application windows theApp.create # Run the application theApp.run # ============= end ============ -- View this message in context: http://www.nabble.com/Tab-control-using-FXRuby-tp19343124p19343124.html Sent from the FXRuby Users mailing list archive at Nabble.com. From natarajnarayan at vaaraahi.com Sat Sep 6 06:02:36 2008 From: natarajnarayan at vaaraahi.com (natarajnarayan at vaaraahi.com) Date: Sat, 06 Sep 2008 15:32:36 +0530 Subject: [fxruby-users] calendar control Message-ID: <20080906153236.jxbrmd0x4ocsckkc@webmail.vaaraahi.com> Hi Is there a way to add a calendar component to my Dialog Box so that user may select a date? Is there a DateEdit kinda component as in Delphi? regards Nataraj ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From rovshanb at gmail.com Sat Sep 6 00:58:26 2008 From: rovshanb at gmail.com (Rovshan Baghirov) Date: Sat, 6 Sep 2008 09:58:26 +0500 Subject: [fxruby-users] Custom FXTableItem Message-ID: <2427e580809052158i50a1bf01t7ad4b009b8d73b63@mail.gmail.com> Hi, I recently started a new project in order to learn FXRuby and to create something useful at the same time :) . It uses FXTable widget to display tables from database and other lists. I implemented a ComboxBoxTableItem class in order to display lists and TextFieldTableItem to make it possible select part of cell contents while keeping it read-only. Now when I start typing something in custom table item and then press Tab key without first pressing Enter in order to accept changes, application crashes with Segmentation Fault error. I've attached two screenshots and the code is below: class ComboBoxTableItem < FXTableItem def initialize(text, tnsnames) super(text) @tnsnames=tnsnames end def getControlFor(table) drp=FXComboBox.new(table, 10, :opts=>LAYOUT_FILL) drp.numVisible=10 drp.text=self.text @tnsnames.each{ |item| drp.appendItem(item.to_s.upcase) } drp.currentItem=drp.findItem(self.text.upcase) drp.create drp end def setFromControl(control) self.text=control.text end end Putting begin rescue around method bodies did not help. Could you please, help me to find the problem and fix it? Thanks in advance, Rovshan -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: oexp1.jpg Type: image/jpeg Size: 97826 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: oexp2.jpg Type: image/jpeg Size: 110639 bytes Desc: not available URL: From jeroen at fox-toolkit.org Sat Sep 6 09:55:20 2008 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Sat, 6 Sep 2008 08:55:20 -0500 Subject: [fxruby-users] calendar control In-Reply-To: <20080906153236.jxbrmd0x4ocsckkc@webmail.vaaraahi.com> References: <20080906153236.jxbrmd0x4ocsckkc@webmail.vaaraahi.com> Message-ID: <200809060855.20673.jeroen@fox-toolkit.org> On Saturday 06 September 2008, natarajnarayan at vaaraahi.com wrote: > Hi > > Is there a way to add a calendar component to my Dialog Box so that > user may select a date? Yes. > Is there a DateEdit kinda component as in Delphi? Yes, see attached images. These are new widgets for the FOX 1.7 branch ftp://ftp.fox-toolkit.org/pub/fox-1.7.17.tar.gz I'm not sure if the FXRuby bindings for the 1.7 are available yet [Lyle?] - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 08:40 09/ 6/2008 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ -------------- next part -------------- A non-text attachment was scrubbed... Name: calendar_control_1.jpg Type: image/jpeg Size: 63452 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: calendar_control_2.jpg Type: image/jpeg Size: 102496 bytes Desc: not available URL: From philippe.lang at attiksystem.ch Mon Sep 8 07:12:06 2008 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Mon, 8 Sep 2008 13:12:06 +0200 Subject: [fxruby-users] calendar control References: <20080906153236.jxbrmd0x4ocsckkc@webmail.vaaraahi.com> Message-ID: fxruby-users-bounces at rubyforge.org wrote: > Hi > > Is there a way to add a calendar component to my Dialog Box so that > user may select a date? > > Is there a DateEdit kinda component as in Delphi? Hi, In the "lib" directory of FXRuby 1.6.x, you will find the source code of a calendar widget, which works pretty well for me, but I'm looking forward to testing the native widget of FXRuby 1.7. Regards, Philippe From rovshanb at gmail.com Mon Sep 8 08:03:25 2008 From: rovshanb at gmail.com (Rovshan Baghirov) Date: Mon, 8 Sep 2008 17:03:25 +0500 Subject: [fxruby-users] Custom FXTableItem Message-ID: <2427e580809080503kfb5f102x30e50cf6cd40dae4@mail.gmail.com> Hi, I recently started a new project in order to learn FXRuby. It uses FXTable widget to display tables from database and other lists. I implemented a ComboxBoxTableItem class in order to display lists and TextFieldTableItem to make it possible select part of cell contents while keeping it read-only. Now when I start typing something in custom table item and then press Tab key without first pressing Enter in order to accept changes, application crashes with Segmentation Fault error. I've attached two screenshots (they were not allowed by moderation system, so I'm reposting without attachments) and the code is below: class ComboBoxTableItem < FXTableItem def initialize(text, tnsnames) super(text) @tnsnames=tnsnames end def getControlFor(table) drp=FXComboBox.new(table, 10, :opts=>LAYOUT_FILL) drp.numVisible=10 drp.text=self.text @tnsnames.each{ |item| drp.appendItem(item.to_s.upcase) } drp.currentItem=drp.findItem(self.text.upcase) drp.create drp end def setFromControl(control) self.text=control.text end end My usage: setItem(r, 2, ComboBoxTableItem.new(tns, @tnsnames)) Putting begin rescue around method bodies did not help. Could you please, help me to find the problem and fix it? Do I need to implement other methods as well? Thanks in advance, Rovshan -------------- next part -------------- An HTML attachment was scrubbed... URL: From thilko.richter at googlemail.com Tue Sep 9 03:34:18 2008 From: thilko.richter at googlemail.com (Thilko Richter) Date: Tue, 9 Sep 2008 09:34:18 +0200 Subject: [fxruby-users] Push a button programmatically Message-ID: Hello, I have a dialog box with a FXTextField and two buttons(OK and Cancel). The dialog should be closed if on of the buttons is pressed, or the user hit "ENTER" in the textfield. My dialog is inherited from FXDialogBox. This are my two buttons: ... @connect_button = FXButton.new(buttons, "Connect", :target => self, :selector => FXDialogBox::ID_ACCEPT, :opts => BUTTON_NORMAL | LAYOUT_RIGHT) @cancel_button = FXButton.new(buttons, "Cancel", :target => self, :selector => FXDialogBox::ID_CANCEL, :opts => BUTTON_NORMAL | LAYOUT_RIGHT) ... and this is my textfield: ... @textfield = FXTextField.new(content, 10, :opts => LAYOUT_SIDE_RIGHT | TEXTFIELD_ENTER_ONLY) ... How can I "activate" the button when the user hits enter inthe textfield? I already found some solution which says something like this: ... @connect_button.handle(nil, FXSEL(SEL_LEFTBUTTONPRESS, 0), nil) @connect_button.handle(nil, FXSEL(SEL_LEFTBUTTONRELEASE, 0), nil) ... to simulate a click on the button. Is this the best solution? Thx, Thilko From thilko.richter at googlemail.com Tue Sep 9 05:30:08 2008 From: thilko.richter at googlemail.com (Thilko Richter) Date: Tue, 9 Sep 2008 11:30:08 +0200 Subject: [fxruby-users] Usage of FXDebugTarget Message-ID: Hello, how can I use the FXDebugTarget? As far as I understand that should be the way: ... connect_command = FXMenuCommand.new(server_menu, "Connect", :target => FXDebugTarget.new, :selector => ID_SHOW) ... But no messages are printed out... Thx, Thilko From jeroen at fox-toolkit.org Tue Sep 9 10:02:46 2008 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Tue, 9 Sep 2008 09:02:46 -0500 Subject: [fxruby-users] Push a button programmatically In-Reply-To: References: Message-ID: <200809090902.46539.jeroen@fox-toolkit.org> On Tuesday 09 September 2008, Thilko Richter wrote: > Hello, > > I have a dialog box with a FXTextField and two buttons(OK and Cancel). > The dialog should be closed if on of the buttons is pressed, or the > user hit "ENTER" in the textfield. My dialog is inherited from > FXDialogBox. > > This are my two buttons: > ... > @connect_button = FXButton.new(buttons, "Connect", :target => self, > :selector => FXDialogBox::ID_ACCEPT, :opts => BUTTON_NORMAL | > LAYOUT_RIGHT) > @cancel_button = FXButton.new(buttons, "Cancel", :target => self, > :selector => FXDialogBox::ID_CANCEL, :opts => BUTTON_NORMAL | > LAYOUT_RIGHT) > ... > > and this is my textfield: > ... > @textfield = FXTextField.new(content, 10, :opts => LAYOUT_SIDE_RIGHT | > TEXTFIELD_ENTER_ONLY) > ... > > How can I "activate" the button when the user hits enter inthe > textfield? I already found some solution which says something like > this: > ... > @connect_button.handle(nil, FXSEL(SEL_LEFTBUTTONPRESS, 0), nil) > @connect_button.handle(nil, FXSEL(SEL_LEFTBUTTONRELEASE, 0), nil) > ... > > to simulate a click on the button. Is this the best solution? > > Thx, You can connect SEL_COMMAND from the FXTextField to the ID_ACCEPT of the dialog [no need to write handlers at all, unless you want to grab the value of the textfield & check it first]. When you do this, be sure to set the TEXTFIELD_ENTER_ONLY option on the textfield; it causes a tab out-of the textfield NOT to generate a SEL_COMMAND. Also, you might want to set the focus on this textfield on the first show of the dialog. Other useful things for optimal dialog interaction: setInitial() which is used to identify the widget which is to react to the Return Key when the focus tabs around to widgets which don't interpret this key. Note that a FXTextField becomes the default widget to handle KEY_Return when focus lands on it, and the default reverts to the control identified as the initial default in the dialogbox when focus leaves the text field. - Jeroen From jeroen at fox-toolkit.org Tue Sep 9 09:52:38 2008 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Tue, 9 Sep 2008 08:52:38 -0500 Subject: [fxruby-users] Usage of FXDebugTarget In-Reply-To: References: Message-ID: <200809090852.38472.jeroen@fox-toolkit.org> On Tuesday 09 September 2008, Thilko Richter wrote: > Hello, > > how can I use the FXDebugTarget? As far as I understand that should be the way: > > ... > connect_command = FXMenuCommand.new(server_menu, "Connect", :target => > FXDebugTarget.new, :selector => ID_SHOW) > ... > > But no messages are printed out... > They should appear on the console, or on VC++ Output Window. If you're on *nix, it should be on stderr. - Jeroen From thilko.richter at googlemail.com Wed Sep 10 03:26:27 2008 From: thilko.richter at googlemail.com (Thilko Richter) Date: Wed, 10 Sep 2008 09:26:27 +0200 Subject: [fxruby-users] FXColor Message-ID: Hello, I have some strange problem with FXColor: I cant find the class in the rdoc and if I use the class I get the error message: ... output_frame.rb:20:in `setup': uninitialized constant OutputFrame::FXColor (NameError) ... Include statements are there: ... require 'rubygems' require 'fox16' include Fox ... and when I look in the lib folder of the gem I find the FXColor in the colors.rb I have no idea why this class is not found... FXRGBA(0,0,0,0) works. Thx, Thilko From philippe.lang at attiksystem.ch Wed Sep 10 04:44:54 2008 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Wed, 10 Sep 2008 10:44:54 +0200 Subject: [fxruby-users] FXColor References: Message-ID: fxruby-users-bounces at rubyforge.org wrote: > Hello, > > I have some strange problem with FXColor: I cant find the class in > the rdoc and if I use the class I get the error message: ... > output_frame.rb:20:in `setup': uninitialized constant > OutputFrame::FXColor (NameError) ... > > Include statements are there: > ... > require 'rubygems' > require 'fox16' > include Fox > ... > > and when I look in the lib folder of the gem I find the FXColor in > the colors.rb Hi, I guess you need this: require 'fox16/colors' Regards, Philippe From thilko.richter at googlemail.com Wed Sep 10 06:56:26 2008 From: thilko.richter at googlemail.com (Thilko Richter) Date: Wed, 10 Sep 2008 12:56:26 +0200 Subject: [fxruby-users] FXColor In-Reply-To: References: Message-ID: Thx a lot - it works! 2008/9/10 Philippe Lang : > fxruby-users-bounces at rubyforge.org wrote: >> Hello, >> >> I have some strange problem with FXColor: I cant find the class in >> the rdoc and if I use the class I get the error message: ... >> output_frame.rb:20:in `setup': uninitialized constant >> OutputFrame::FXColor (NameError) ... >> >> Include statements are there: >> ... >> require 'rubygems' >> require 'fox16' >> include Fox >> ... >> >> and when I look in the lib folder of the gem I find the FXColor in >> the colors.rb > > Hi, I guess you need this: > > require 'fox16/colors' > > Regards, > > Philippe > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From lyle at lylejohnson.name Wed Sep 10 09:28:24 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 10 Sep 2008 08:28:24 -0500 Subject: [fxruby-users] FXColor In-Reply-To: References: Message-ID: <57cf8f720809100628i4e9fba1ct3a9effe7ba327165@mail.gmail.com> On Wed, Sep 10, 2008 at 2:26 AM, Thilko Richter wrote: > I have some strange problem with FXColor: I cant find the class in the > rdoc and if I use the class I get the error message: > ... > output_frame.rb:20:in `setup': uninitialized constant > OutputFrame::FXColor (NameError) It's worth noting that while there is an FXColor class, you can't create a (useful) FXColor instance or call methods on an FXColor instance. Fox module methods like FXRGB() and FXRGBA() create integer color values that are then passed into any method or attribute that expects an FXColor. From dragoncity at aanet.com.au Wed Sep 10 21:08:26 2008 From: dragoncity at aanet.com.au (dragoncity) Date: Wed, 10 Sep 2008 18:08:26 -0700 (PDT) Subject: [fxruby-users] How to control Button access ? Message-ID: <19426045.post@talk.nabble.com> I have a data entry form which has a row of Buttons arranged along the bottom. This data entry form is to be used for repetitive entry by experieced users and the code saves the current form to a file when the user Tab's out of the last field, clears the form, then automatically restarts accepting a new record. I would like that the buttons are not automatically visited by pressing the TAB Key , but only used by Mouse Click. Is this arrangement possible ? I have not found any obvious way to stop the buttons being visited via Tab key press. PS: I posted this on Fox-users and received a possible solution, but would like to know if the same idea can be done with FXRuby. === eg ==== One way is to derive FXButton class and override "canFocus()" method: class MyButton : public FXButton { public: FXbool canFocus() const { return false; } } ========= -- View this message in context: http://www.nabble.com/How-to-control-Button-access---tp19426045p19426045.html Sent from the FXRuby Users mailing list archive at Nabble.com. From thilko.richter at googlemail.com Thu Sep 11 08:46:28 2008 From: thilko.richter at googlemail.com (Thilko Richter) Date: Thu, 11 Sep 2008 14:46:28 +0200 Subject: [fxruby-users] TEXT_AUTOSCROLL in FXText with usage of FXDataTarget Message-ID: Hello, I have a FXTextfield connected with a FXDataTarget. My FxTextField is a logging window, so I always would like to see the last line visible. I initialized the FXText with FXText::TEXT_AUTOSCROLL, but, I dont know why, the last line is no keep visible, although I can see the updates of the TextField through the FXDataTarget. Currently I switch to a manually assignment of the text and call "makePositionVisible", but is this the right solution? As far as I understand the TEXT_AUTOSCROLL should always scroll to the end? Thx, Thilko From jeroen at fox-toolkit.org Thu Sep 11 09:44:58 2008 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Thu, 11 Sep 2008 08:44:58 -0500 Subject: [fxruby-users] TEXT_AUTOSCROLL in FXText with usage of FXDataTarget In-Reply-To: References: Message-ID: <200809110844.58183.jeroen@fox-toolkit.org> On Thursday 11 September 2008, Thilko Richter wrote: > Hello, > > I have a FXTextfield connected with a FXDataTarget. My FxTextField is > a logging window, so I always would like to see the last line > visible. I initialized the FXText with FXText::TEXT_AUTOSCROLL, but, I > dont know why, the last line is no keep visible, although I can see > the updates of the TextField through the FXDataTarget. Currently I > switch to a manually assignment of the text and call > "makePositionVisible", but is this the right solution? > > As far as I understand the TEXT_AUTOSCROLL should always scroll to the end? Actually, TEXT_AUTOSCROLL isn't implemented ;-) Its not common to connect FXText via FXDataTarget, on account of the amount of data that may be transferred, and the huge cost of updating text metrics non- incrementally. My suggestion is to append text piecemeal fashion: text->appendText(string); text->makePositionVisible(text->getLength()); This will incrementally update and scroll to the last character position. If you're adding a LOT of text, you may want to: excess=text->getNumRows()-maximum_number_of_rows; if(0removeText(0,text->countRows(0,excess)); Which will trim from the top of the widget, to keep the number of lines less than maximum_number_of_rows. Hope this helps, - Jeroen From lyle at lylejohnson.name Thu Sep 11 10:35:09 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 11 Sep 2008 09:35:09 -0500 Subject: [fxruby-users] How to control Button access ? In-Reply-To: <19426045.post@talk.nabble.com> References: <19426045.post@talk.nabble.com> Message-ID: <57cf8f720809110735m47f59120y37d112f2ce0ad99c@mail.gmail.com> On Wed, Sep 10, 2008 at 8:08 PM, dragoncity wrote: > PS: I posted this on Fox-users and received a possible solution, but would > like to know if the same idea can be done with FXRuby. > > === eg ==== > One way is to derive FXButton class and override "canFocus()" method: > > class MyButton : public FXButton { > public: > FXbool canFocus() const { return false; } > } > ========= Yes, the same approach should work in FXRuby. In fact, you should in theory be able to just override the canFocus? method on a particular button instance without having to subclass FXButton, e.g. no_focus_button = FXButton.new(...) def no_focus_button.canFocus?; false; end Hope this helps, Lyle From dragoncity at aanet.com.au Fri Sep 12 02:31:30 2008 From: dragoncity at aanet.com.au (dragoncity) Date: Thu, 11 Sep 2008 23:31:30 -0700 (PDT) Subject: [fxruby-users] How to control Button access ? In-Reply-To: <57cf8f720809110735m47f59120y37d112f2ce0ad99c@mail.gmail.com> References: <19426045.post@talk.nabble.com> <57cf8f720809110735m47f59120y37d112f2ce0ad99c@mail.gmail.com> Message-ID: <19450261.post@talk.nabble.com> Not quite :-) in the attached code I modified the "newbtn" routine as you suggested, it compiles OK , but still visits "newbtn" after Tabbing out of the last data field. Clicking on "newbtn" processes as expected. eg: newbtn= FXButton.new(btns, "New", :opts => LAYOUT_FILL_X| BUTTON_NORMAL) def newbtn.canFocus?;false; end newbtn.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## puts "new button pressed" end # new BTW the program is self contained so should be runnable. ======================== program =========== #!/usr/bin/env ruby # /home/brett/Ruby_Stuff/Ruby_Fox_Gen/zestaddr2.rb # Generated by RubyFXGen.rb Ver 0.9a on :Mon Sep 01 17:20:31 +1000 2008 # plus added code to setup scroller require 'fox16' include Fox class MainWindow < FXMainWindow def initialize(app) super( app, 'Zest Address Entry') self.width = 422 self.height = 250 amain= FXVerticalFrame.new(self,LAYOUT_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) main = FXScrollWindow.new(amain, LAYOUT_FILL_X|LAYOUT_FILL_Y) addr= FXMatrix.new(main, 2,MATRIX_BY_COLUMNS|LAYOUT_CENTER_X) # addr FXLabel.new(addr, "First Name" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld1= FXDataTarget.new("") fld1a=FXTextField.new(addr,20, fld1, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld1a.connect(SEL_COMMAND) do puts "fld1 contains #{fld1.value}" main.setPosition(-10, -10) end FXLabel.new(addr, "Surname" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld2= FXDataTarget.new("") FXTextField.new(addr,20, fld2, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld2.connect(SEL_COMMAND) do puts "fld2 contains #{fld2.value}" main.setPosition(-20, -20) end FXLabel.new(addr, "Company Name" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld3= FXDataTarget.new("") FXTextField.new(addr,20, fld3, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) fld3.connect(SEL_COMMAND) do puts "fld3 contains #{fld3.value}" main.setPosition(-30, -30) end FXLabel.new(addr, "Addr1" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr1= FXDataTarget.new("") FXTextField.new(addr,20, addr1, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr1.connect(SEL_COMMAND) do puts "addr1 contains #{addr1.value}" main.setPosition(-40, -40) end FXLabel.new(addr, "Addr2" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr2= FXDataTarget.new("") FXTextField.new(addr,20, addr2, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr2.connect(SEL_COMMAND) do puts "addr2 contains #{addr2.value}" main.setPosition(-50, -50) end FXLabel.new(addr, "Addr3" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr3= FXDataTarget.new("") FXTextField.new(addr,20, addr3, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) addr3.connect(SEL_COMMAND) do puts "addr3 contains #{addr3.value}" main.setPosition(-70, -70) end FXLabel.new(addr, "PostCode" , nil,LABEL_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y) postcode= FXDataTarget.new("") FXTextField.new(addr,20, postcode, FXDataTarget::ID_VALUE, FRAME_SUNKEN|LAYOUT_FILL_X|LAYOUT_FILL_Y) postcode.connect(SEL_COMMAND) do puts "postcode contains #{postcode.value}" main.setPosition(-0, -0) ## scroll back to first field ( it does ) fld1a.setFocus ## focus on first field ( it does NOT ! -> first BUTTON "New" ) end btns= FXHorizontalFrame.new(amain, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN) # btns newbtn= FXButton.new(btns, "New", :opts => LAYOUT_FILL_X| BUTTON_NORMAL) def newbtn.canFocus?;false; end newbtn.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## puts "new button pressed" end # new clearbtn= FXButton.new(btns,"Clear", :opts => LAYOUT_FILL_X|BUTTON_NORMAL) clearbtn.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## end # clear loadbtn= FXButton.new(btns,"Load", :opts=> LAYOUT_FILL_X|BUTTON_NORMAL) loadbtn.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## end # load savebtn= FXButton.new(btns,"Save", :opts=>LAYOUT_FILL_X|BUTTON_NORMAL) savebtn.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## end # save quitbtn= FXButton.new(btns,"Quit", :opts=>LAYOUT_FILL_X|BUTTON_NORMAL) quitbtn.connect(SEL_COMMAND) do |sender, sel, checked| # ## your button press code here ## exit() end # quit # set initial field address fld1a.setFocus end # def initilize def create super show(PLACEMENT_SCREEN) end # create end # class MainWindow # ============= main prog ============ # Construct an application theApp = FXApp.new('Smithy','Max') # Construct the main window theApp.normalFont = FXFont.new(theApp,'Adobe Courier',12,FONTWEIGHT_BOLD) # define default display FONT for this application MainWindow.new(theApp) # Create and show the application windows theApp.create # Run the application theApp.run # ============= end ============ Lyle Johnson-4 wrote: > > On Wed, Sep 10, 2008 at 8:08 PM, dragoncity > wrote: > >> PS: I posted this on Fox-users and received a possible solution, but >> would >> like to know if the same idea can be done with FXRuby. >> >> === eg ==== >> One way is to derive FXButton class and override "canFocus()" method: >> >> class MyButton : public FXButton { >> public: >> FXbool canFocus() const { return false; } >> } >> ========= > > Yes, the same approach should work in FXRuby. In fact, you should in > theory be able to just override the canFocus? method on a particular > button instance without having to subclass FXButton, e.g. > > no_focus_button = FXButton.new(...) > def no_focus_button.canFocus?; false; end > > Hope this helps, > > Lyle > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > -- View this message in context: http://www.nabble.com/How-to-control-Button-access---tp19426045p19450261.html Sent from the FXRuby Users mailing list archive at Nabble.com. From thilko.richter at googlemail.com Fri Sep 12 05:03:57 2008 From: thilko.richter at googlemail.com (Thilko Richter) Date: Fri, 12 Sep 2008 11:03:57 +0200 Subject: [fxruby-users] SEL_COMMAND if text of current item in FXComboBox has changed Message-ID: Good Morning, I have a FXComboBox widget where I would like to change the text of the current item. Since there is some model data to be updated (not connected via FxDataTarget), I need to handle the SEL_COMMAND message (the handler block is connected). Actually I do this: ... box.setItemText(box.currentItem, text) box.setCurrentItem(box.currentItem, true) ... It seems that the SEL_COMMAND message was not sent by the ComboBox. Do I forget something? Thx, Thilko From rovshanb at gmail.com Mon Sep 15 09:01:13 2008 From: rovshanb at gmail.com (Rovshan Baghirov) Date: Mon, 15 Sep 2008 18:01:13 +0500 Subject: [fxruby-users] FXDialogBox without focus Message-ID: <2427e580809150601l6e5e5f60q939092bdb6298fc4@mail.gmail.com> Hi, is it possible to display a non modal dialog box without giving it the focus? I use this code, but without success: @autocomplete=AutocompleteDialog.new(self, pointXFromPosition(pos), pointYFromPosition(pos)+20) @autocomplete.create @autocomplete.show self.setFocus self is FXScintilla component. Thanks, Rovshan -------------- next part -------------- An HTML attachment was scrubbed... URL: From rovshanb at gmail.com Tue Sep 16 01:15:23 2008 From: rovshanb at gmail.com (Rovshan Baghirov) Date: Tue, 16 Sep 2008 10:15:23 +0500 Subject: [fxruby-users] FXDialogBox without focus In-Reply-To: <2427e580809150601l6e5e5f60q939092bdb6298fc4@mail.gmail.com> References: <2427e580809150601l6e5e5f60q939092bdb6298fc4@mail.gmail.com> Message-ID: <2427e580809152215p23bd3bfg28cff6d03b7338cd@mail.gmail.com> This seems to work: (in dialog constructor) @first_time=true connect(SEL_FOCUSIN){self.killFocus if @first_time; @first_time=false} On Mon, Sep 15, 2008 at 6:01 PM, Rovshan Baghirov wrote: > Hi, > > is it possible to display a non modal dialog box without giving it the > focus? > I use this code, but without success: > > @autocomplete=AutocompleteDialog.new(self, pointXFromPosition(pos), > pointYFromPosition(pos)+20) > @autocomplete.create > @autocomplete.show > self.setFocus > > self is FXScintilla component. > > Thanks, > Rovshan > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thilko.richter at googlemail.com Wed Sep 17 09:12:50 2008 From: thilko.richter at googlemail.com (Thilko Richter) Date: Wed, 17 Sep 2008 15:12:50 +0200 Subject: [fxruby-users] Create on FXDialogBox Message-ID: Hello, just a matter of understanding: As far as I have understand, I have to call create() on every widget that I construct during runtime of my application to create the server side ressources. After revisiting my code, I found some widgets where I have forgotten to call create() ;-) - but - I dont know why, the widgets in the dialogbox are shown. I could not explain me this behauviour, it this maybe done in the execute() method of the FXDialogBox? Thanks a lot, Thilko From jeroen at fox-toolkit.org Wed Sep 17 11:25:47 2008 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Wed, 17 Sep 2008 10:25:47 -0500 Subject: [fxruby-users] Create on FXDialogBox In-Reply-To: References: Message-ID: <200809171025.47196.jeroen@fox-toolkit.org> On Wednesday 17 September 2008, Thilko Richter wrote: > Hello, > > just a matter of understanding: As far as I have understand, I have to > call create() on every widget that I construct during runtime of my > application to create the server side ressources. After revisiting my > code, I found some widgets where I have forgotten to call create() ;-) > - but - I dont know why, the widgets in the dialogbox are shown. I > could not explain me this behauviour, it this maybe done in the > execute() method of the FXDialogBox? In principle, yes! Each widget is first constructed, then created (realized). When you construct a widget, you're essentially just filling in a C++ data structure, and initializing it with particular member data. When you create() it, a resource is allocated for it in the system (X11 or GDI); for example, when you create a window, a HWND will be associated with the C++ class, and when you create an image, a DIB will be associated, and so on. Now, all widgets are typically connected in a widget-tree, and since create() recurses downward through this widget-tree, calling create() in FXApp will effectively realize all the resources in one fell swoop. If you never construct any other widgets later on, then this single call to create() will suffice. However, not-trivial applications will likely at the very least bring up some dialog boxes, so these must be created explicitly after being constructed. As a convenience, for the common case for modal dialogs, the execute() api will also call create() along the way, and thus you won't have to call it explicitly in that case. In other cases, create() must be called explicitly. Keeping in mind that create() recurses through the widget hierarchy, and creates every REACHABLE resource from this hierachy, it is enough to call create() only on the top-most widget of your dialog. Hope this helps, - Jeroen From hans at hpelbers.org Wed Sep 17 11:08:30 2008 From: hans at hpelbers.org (Hans Elbers) Date: Wed, 17 Sep 2008 17:08:30 +0200 Subject: [fxruby-users] Create on FXDialogBox In-Reply-To: References: Message-ID: <200809171708.30206.hans@hpelbers.org> Hi, When you call create on a widget, its children are created automically. Hans. On Wednesday 17 September 2008 15:12:50 Thilko Richter wrote: > Hello, > > just a matter of understanding: As far as I have understand, I have to > call create() on every widget that I construct during runtime of my > application to create the server side ressources. After revisiting my > code, I found some widgets where I have forgotten to call create() ;-) > - but - I dont know why, the widgets in the dialogbox are shown. I > could not explain me this behauviour, it this maybe done in the > execute() method of the FXDialogBox? > > Thanks a lot, > > Thilko > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users From tsmith at tektone.net Fri Sep 19 16:31:59 2008 From: tsmith at tektone.net (Tim Smith) Date: Fri, 19 Sep 2008 16:31:59 -0400 Subject: [fxruby-users] FXTableItem.new segmentation fault Message-ID: <6B90560780C80940BB5EE1D6650C2D75FF3CD5@mail.tektone.net> Does the following code crash for anyone else? My app is unpredictably crashing with a segmentation fault, which I can sometimes reproduce with this contrived test case. require 'fox16'; include Fox start = Time.now count = 0 items = [] while true 28125.times {|i| items[i] = FXTableItem.new '' } count += 1 puts "#{count}, after #{Time.now - start} seconds" end The eventual error: c:/program files/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16 /kwargs.rb:2367: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i386-mswin32] I've had this code crash on XP and Vista (but not Linux), often in under a minute, though not always. Does anyone know what might be going on? Thanks for any help, Tim Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Fri Sep 19 17:28:33 2008 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Fri, 19 Sep 2008 23:28:33 +0200 Subject: [fxruby-users] FXTableItem.new segmentation fault In-Reply-To: <6B90560780C80940BB5EE1D6650C2D75FF3CD5@mail.tektone.net> References: <6B90560780C80940BB5EE1D6650C2D75FF3CD5@mail.tektone.net> Message-ID: <43d756720809191428j111deeaeo644dedf84d00ecb2@mail.gmail.com> are you running out of GDI handles? On Fri, Sep 19, 2008 at 10:31 PM, Tim Smith wrote: > Does the following code crash for anyone else? My app is unpredictably > crashing with a segmentation fault, which I can sometimes reproduce with > this contrived test case. > > > > require 'fox16'; include Fox > > > > start = Time.now > > count = 0 > > items = [] > > while true > > 28125.times {|i| > > items[i] = FXTableItem.new '' > > } > > count += 1 > > puts "#{count}, after #{Time.now - start} seconds" > > end > > > > The eventual error: > > > > c:/program files/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:2367: [BUG] Segmentation fault > > ruby 1.8.6 (2007-09-24) [i386-mswin32] > > > > I've had this code crash on XP and Vista (but not Linux), often in under a > minute, though not always. Does anyone know what might be going on? > > > > Thanks for any help, > > > > Tim Smith > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsmith at tektone.net Fri Sep 19 18:21:19 2008 From: tsmith at tektone.net (Tim Smith) Date: Fri, 19 Sep 2008 18:21:19 -0400 Subject: [fxruby-users] FXTableItem.new segmentation fault Message-ID: <6B90560780C80940BB5EE1D6650C2D75FF3CE1@mail.tektone.net> I don't think so. For that process, Task Manager shows 38 Handles, 1 USER Object, and 5 GDI Objects on my XP machine, and 72 Handles, 1 USER Object, and 4 GDI Objects on my Vista machine. None of those numbers seem to increase before it crashes. Tim Smith ________________________________ From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Meinrad Recheis Sent: Friday, September 19, 2008 5:29 PM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXTableItem.new segmentation fault are you running out of GDI handles? On Fri, Sep 19, 2008 at 10:31 PM, Tim Smith wrote: Does the following code crash for anyone else? My app is unpredictably crashing with a segmentation fault, which I can sometimes reproduce with this contrived test case. require 'fox16'; include Fox start = Time.now count = 0 items = [] while true 28125.times {|i| items[i] = FXTableItem.new '' } count += 1 puts "#{count}, after #{Time.now - start} seconds" end The eventual error: c:/program files/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16 /kwargs.rb:2367: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i386-mswin32] I've had this code crash on XP and Vista (but not Linux), often in under a minute, though not always. Does anyone know what might be going on? Thanks for any help, Tim Smith _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From philippe.lang at attiksystem.ch Mon Sep 22 03:09:37 2008 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Mon, 22 Sep 2008 09:09:37 +0200 Subject: [fxruby-users] FXTableItem.new segmentation fault References: <6B90560780C80940BB5EE1D6650C2D75FF3CD5@mail.tektone.net> Message-ID: Hi, Your program is running just fine on my computer, for over 220 seconds now. I'm using: - Windows XP SP2 - ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] - fxruby (1.6.14) Philippe _____ De : fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] De la part de Tim Smith Envoy? : vendredi, 19. septembre 2008 22:32 ? : fxruby-users at rubyforge.org Objet : [fxruby-users] FXTableItem.new segmentation fault Does the following code crash for anyone else? My app is unpredictably crashing with a segmentation fault, which I can sometimes reproduce with this contrived test case. require 'fox16'; include Fox start = Time.now count = 0 items = [] while true 28125.times {|i| items[i] = FXTableItem.new '' } count += 1 puts "#{count}, after #{Time.now - start} seconds" end The eventual error: c:/program files/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:2367: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i386-mswin32] I've had this code crash on XP and Vista (but not Linux), often in under a minute, though not always. Does anyone know what might be going on? Thanks for any help, Tim Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From H.P.Elbers at boskalis.nl Tue Sep 23 10:30:03 2008 From: H.P.Elbers at boskalis.nl (Elbers, H.P.) Date: Tue, 23 Sep 2008 16:30:03 +0200 Subject: [fxruby-users] TEXT_AUTOSCROLL option in FXText does not work? Message-ID: I think the TEXT_AUTOSCROLL option in FXText does not work (last line is not visible)... Version: 1.6.16 Example code: #!/usr/bin/env ruby require 'fox16' include Fox class Scroller < FXMainWindow def initialize(app) super(app, "Test", :opts => DECOR_ALL, :width => 800, :height => 400) FXButton.new(self, "Go!!!").connect(SEL_COMMAND, method(:onGo)) @out = FXText.new(self, :opts => TEXT_AUTOSCROLL|LAYOUT_FILL_X|LAYOUT_FILL_Y) end def create super show(PLACEMENT_SCREEN) end def onGo(sender, sel, ptr) 100.times do |i| @out.appendText "line #{i}\n" end return 1 end end application = FXApp.new('Scroller', 'Test') Scroller.new(application) application.create application.run -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Tue Sep 23 11:03:41 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 23 Sep 2008 10:03:41 -0500 Subject: [fxruby-users] TEXT_AUTOSCROLL option in FXText does not work? In-Reply-To: References: Message-ID: <57cf8f720809230803g2c5cb275qd203ec6fe7a4618c@mail.gmail.com> On Tue, Sep 23, 2008 at 9:30 AM, Elbers, H.P. wrote: > I think the TEXT_AUTOSCROLL option in FXText does not work (last line is not > visible)... You are correct. Jeroen has recently indicated that TEXT_AUTOSCROLL is not actually implemented; see: http://www.nabble.com/TEXT_AUTOSCROLL-in-FXText-with-usage-of-FXDataTarget-td19433983.html I will probably remove that option from the documentation for FXText until it's actually working. Hope this helps, Lyle From lyle at lylejohnson.name Tue Sep 23 11:04:53 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 23 Sep 2008 10:04:53 -0500 Subject: [fxruby-users] How to control Button access ? In-Reply-To: <32298502.1087931221534891571.JavaMail.nabble@isper.nabble.com> References: <32298502.1087931221534891571.JavaMail.nabble@isper.nabble.com> Message-ID: <57cf8f720809230804k65705095iced2be8dcc42374e@mail.gmail.com> On Mon, Sep 15, 2008 at 10:14 PM, wrote: > Lyle, sorry to bother you but I still cant get the desired controll over the Buttons, > in the attached code I modified the "newbtn" routine hopefully as you suggested, it compiles OK , but still visits "newbtn" > after Tabbing out of the last data field. Clicking on "newbtn" processes as expected. Could you try replacing "canFocus?" with "canFocus" (i.e. remove the trailing question mark) and see if that makes a difference? From rmelton at ball.com Tue Sep 23 11:06:59 2008 From: rmelton at ball.com (Melton, Ryan) Date: Tue, 23 Sep 2008 09:06:59 -0600 Subject: [fxruby-users] TEXT_AUTOSCROLL option in FXText does not work? In-Reply-To: <57cf8f720809230803g2c5cb275qd203ec6fe7a4618c@mail.gmail.com> References: <57cf8f720809230803g2c5cb275qd203ec6fe7a4618c@mail.gmail.com> Message-ID: <2EC28B773AF39E47850AC45765483C2C026B254C@AEROMSG2.AERO.BALL.COM> Here is the code I use to implement auto scroll: text = text_widget.output.text vis_position = text.length - 1 (text.length - 2).downto(0) do |index| if text[index..index] == "\n" vis_position = index + 1 break end end text_widget.output.makePositionVisible(vis_position) Ryan -----Original Message----- From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Lyle Johnson Sent: Tuesday, September 23, 2008 9:04 AM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] TEXT_AUTOSCROLL option in FXText does not work? On Tue, Sep 23, 2008 at 9:30 AM, Elbers, H.P. wrote: > I think the TEXT_AUTOSCROLL option in FXText does not work (last line is not > visible)... You are correct. Jeroen has recently indicated that TEXT_AUTOSCROLL is not actually implemented; see: http://www.nabble.com/TEXT_AUTOSCROLL-in-FXText-with-usage-of-FXDataTarget-td19433983.html I will probably remove that option from the documentation for FXText until it's actually working. Hope this helps, Lyle _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. From tsmith at tektone.net Wed Sep 24 20:20:12 2008 From: tsmith at tektone.net (Tim Smith) Date: Wed, 24 Sep 2008 20:20:12 -0400 Subject: [fxruby-users] FXTableItem.new segmentation fault Message-ID: <6B90560780C80940BB5EE1D6650C2D75FF4186@mail.tektone.net> It can be unpredictable. Sometimes it crashes if you just tweak it a bit, say by increasing the array size from 28125 to 281250, or creating multiple arrays. I've now had it crash on Linux, with ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-linux], and FXRuby 1.6.16. That error message is more detailed: FXRuby.cpp:1472: FXASSERT(!NIL_P(obj)) failed. /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb:2367:in `old_initialize': undefined method `getIcon' for nil:NilClass (NoMethodError) from /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb:2367:in `initialize' So it looks like in FXRuby.cpp, FXRbCallIconMethod() is calling FXRbGetRubyObj() and getting back nil? Tim Smith ________________________________ From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Philippe Lang Sent: Monday, September 22, 2008 3:10 AM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXTableItem.new segmentation fault Hi, Your program is running just fine on my computer, for over 220 seconds now. I'm using: - Windows XP SP2 - ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] - fxruby (1.6.14) Philippe ________________________________ De : fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] De la part de Tim Smith Envoy? : vendredi, 19. septembre 2008 22:32 ? : fxruby-users at rubyforge.org Objet : [fxruby-users] FXTableItem.new segmentation fault Does the following code crash for anyone else? My app is unpredictably crashing with a segmentation fault, which I can sometimes reproduce with this contrived test case. require 'fox16'; include Fox start = Time.now count = 0 items = [] while true 28125.times {|i| items[i] = FXTableItem.new '' } count += 1 puts "#{count}, after #{Time.now - start} seconds" end The eventual error: c:/program files/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:2367: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i386-mswin32] I've had this code crash on XP and Vista (but not Linux), often in under a minute, though not always. Does anyone know what might be going on? Thanks for any help, Tim Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From philippe.lang at attiksystem.ch Thu Sep 25 01:57:48 2008 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Thu, 25 Sep 2008 07:57:48 +0200 Subject: [fxruby-users] FXTableItem.new segmentation fault References: <6B90560780C80940BB5EE1D6650C2D75FF4186@mail.tektone.net> Message-ID: Maybe you should try with FXRuby 1.6.14? _____ De : fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] De la part de Tim Smith Envoy? : jeudi, 25. septembre 2008 02:20 ? : fxruby-users at rubyforge.org Objet : Re: [fxruby-users] FXTableItem.new segmentation fault It can be unpredictable. Sometimes it crashes if you just tweak it a bit, say by increasing the array size from 28125 to 281250, or creating multiple arrays. I've now had it crash on Linux, with ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-linux], and FXRuby 1.6.16. That error message is more detailed: FXRuby.cpp:1472: FXASSERT(!NIL_P(obj)) failed. /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb:2367:in `old_initialize': undefined method `getIcon' for nil:NilClass (NoMethodError) from /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb:2367:in `initialize' So it looks like in FXRuby.cpp, FXRbCallIconMethod() is calling FXRbGetRubyObj() and getting back nil? Tim Smith _____ From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Philippe Lang Sent: Monday, September 22, 2008 3:10 AM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXTableItem.new segmentation fault Hi, Your program is running just fine on my computer, for over 220 seconds now. I'm using: - Windows XP SP2 - ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] - fxruby (1.6.14) Philippe _____ De : fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] De la part de Tim Smith Envoy? : vendredi, 19. septembre 2008 22:32 ? : fxruby-users at rubyforge.org Objet : [fxruby-users] FXTableItem.new segmentation fault Does the following code crash for anyone else? My app is unpredictably crashing with a segmentation fault, which I can sometimes reproduce with this contrived test case. require 'fox16'; include Fox start = Time.now count = 0 items = [] while true 28125.times {|i| items[i] = FXTableItem.new '' } count += 1 puts "#{count}, after #{Time.now - start} seconds" end The eventual error: c:/program files/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:2367: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i386-mswin32] I've had this code crash on XP and Vista (but not Linux), often in under a minute, though not always. Does anyone know what might be going on? Thanks for any help, Tim Smith -------------- next part -------------- An HTML attachment was scrubbed... URL: From lcl at tarazed.demon.co.uk Thu Sep 25 03:55:20 2008 From: lcl at tarazed.demon.co.uk (Len Lawrence) Date: Thu, 25 Sep 2008 08:55:20 +0100 Subject: [fxruby-users] FXTableItem.new segmentation fault In-Reply-To: <6B90560780C80940BB5EE1D6650C2D75FF4186@mail.tektone.net> References: <6B90560780C80940BB5EE1D6650C2D75FF4186@mail.tektone.net> Message-ID: <48DB43E8.4010906@tarazed.demon.co.uk> Tim Smith wrote: > > Does the following code crash for anyone else? My app is unpredictably > crashing with a segmentation fault, which I can sometimes reproduce > with this contrived test case. > > require 'fox16'; include Fox > > start = Time.now > count = 0 > items = [] > while true > 28125.times {|i| > items[i] = FXTableItem.new '' > } > count += 1 > puts "#{count}, after #{Time.now - start} seconds" > end > > The eventual error: > > c:/program files/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:2367: [BUG] Segmentation fault > ruby 1.8.6 (2007-09-24) [i386-mswin32] > > I?ve had this code crash on XP and Vista (but not Linux), often in > under a minute, though not always. Does anyone know what might be > going on? > > Thanks for any help, > Hi Tim It has been running for nearly an hour now on kernel 2.6.24.7-desktop-1mnb with ruby 1.8.7 (2008-05-31 patchlevel 0) [x86_64-linux] fxruby 1.6.14 swapping cores at regular intervals, average cpu use 50%. 4 Gb RAM. Count 4641 after 3680 seconds. Len From tsmith at tektone.net Thu Sep 25 13:43:45 2008 From: tsmith at tektone.net (Tim Smith) Date: Thu, 25 Sep 2008 13:43:45 -0400 Subject: [fxruby-users] FXTableItem.new segmentation fault Message-ID: <6B90560780C80940BB5EE1D6650C2D75FF42AF@mail.tektone.net> I've had it crash with FXRuby 1.6.14 on XP, Vista, and Linux. I've also had it crash with ruby 1.8.7 on Linux, with the same failed assertion (FXRuby.cpp:1472), and the message "object allocation during garbage collection phase". I'm including a tweaked version below which seems to crash more reliably within the first few minutes. I'm also including a backtrace below. It appears that during the initialization of an FXTableItem, FXRbRegisterRubyObj() was called to associate the Ruby object with the Fox object in FXRuby_Objects. But while this was happening, garbage collection occurred, causing FXRbTableItem::markfunc() to be called, which called getIcon(), which led to a lookup in FXRuby_Objects for the Ruby object which was still in the process of being inserted there. Tim Smith require 'fox16'; include Fox start = Time.now count = 0 items = [] while true 10.times {|j| items[j] = [] 28125.times {|i| items[j][i] = FXTableItem.new '' } } count += 1 puts "#{count}, after #{Time.now - start} seconds" end FXRuby.cpp:1472: FXASSERT(!NIL_P(obj)) failed. Breakpoint 1, rb_exc_raise (mesg=0) at eval.c:4616 4616 in eval.c (gdb) bt #0 rb_exc_raise (mesg=0) at eval.c:4616 #1 0x0805fb07 in rb_method_missing (argc=1, argv=0xfeefcff0, obj=4) at eval.c:5630 #2 0x0805c192 in rb_call0 (klass=4143832220, recv=4, id=3889, oid=4277134704, argc=1, argv=0xfeefcff0, body=0xf6fdc130, flags=2) at eval.c:5702 #3 0x0805c70b in rb_call (klass=4143832220, recv=4, mid=3889, argc=1, argv=0xfeefcff0, scope=1, self=6) at eval.c:6094 #4 0x0805cd4e in rb_funcall2 (recv=0, mid=3889, argc=1, argv=0xfeefcff0) at ruby.h:679 #5 0x0806008a in method_missing (obj=4, id=8311054, argc=0, argv=0x0, call_status=-17832592) at eval.c:5671 #6 0x0805c744 in rb_call (klass=4143829940, recv=4, mid=32465, argc=0, argv=0x0, scope=1, self=6) at eval.c:6090 #7 0x0805cfb6 in vafuncall (recv=4, mid=32465, n=0, ar=0xfeefd0f4) at ruby.h:679 #8 0x0805d0d2 in rb_funcall (recv=4277134704, mid=0, n=0) at eval.c:6188 #9 0xf6b274d7 in FXRbCallIconMethod (recv=0x9e511c0, func=32465) at FXRuby.cpp:1473 #10 0xf6b02dff in FXRbTableItem::getIcon (this=0x9e511c0) at impl.cpp:1011 #11 0xf6920945 in FXRbTableItem::markfunc (self=0x9e511c0) at markfuncs.cpp:517 #12 0x0806b672 in gc_mark_children (ptr=4129486760, lev=1) at gc.c:945 #13 0x0806bbca in mark_locations_array (x=0xfeefd9fc, n=5357) at gc.c:629 #14 0x0806be3e in garbage_collect () at gc.c:1368 #15 0x0806c7b2 in ruby_xmalloc (size=65708) at gc.c:103 #16 0x0806c96d in ruby_xcalloc (n=16427, size=65708) at gc.c:123 #17 0x080a9d35 in rehash (table=0x965ad78) at st.c:324 #18 0x080a9eb0 in st_insert (table=0x965ad78, key=166007232, value=166007264) at st.c:293 #19 0xf6b23c74 in FXRbRegisterRubyObj (rubyObj=4129486760, foxObj=0x9e511c0) at FXRuby.cpp:253 #20 0xf69b71c7 in _wrap_new_FXTableItem (argc=3, argv=0xfeefe630, self=4129486760) at table_wrap.cpp:846 #21 0x0805c192 in rb_call0 (klass=4143645140, recv=4129486760, id=73137, oid=4277134704, argc=3, argv=0xfeefe630, body=0xf6fafc34, flags=2) at eval.c:5702 #22 0x0805c70b in rb_call (klass=4143645140, recv=4129486760, mid=73137, argc=3, argv=0xfeefe630, scope=1, self=4129486760) at eval.c:6094 #23 0x08058773 in rb_eval (self=4129486760, n=0x0) at ruby.h:679 #24 0x08061bac in block_pass (self=4129486760, node=0xf635360c) at eval.c:8884 #25 0x08058d56 in rb_eval (self=4129486760, n=0x0) at eval.c:3189 #26 0x0805c06a in rb_call0 (klass=4143645140, recv=4129486760, id=2961, oid=4277134704, argc=0, argv=0xfeeff8c4, body=0xf63546c4, flags=2) at eval.c:5998 #27 0x0805c70b in rb_call (klass=4143645140, recv=4129486760, mid=2961, argc=1, argv=0xfeeff8c0, scope=1, self=6) at eval.c:6094 #28 0x0805ccfc in rb_funcall2 (recv=0, mid=2961, argc=1, argv=0xfeeff8c0) at ruby.h:679 #29 0x0805cd9a in rb_obj_call_init (obj=4129486760, argc=1, argv=0xfeeff8c0) at eval.c:7626 #30 0x0807f490 in rb_class_new_instance (argc=1, argv=0xfeeff8c0, klass=4143645140) at object.c:1594 #31 0x0805c192 in rb_call0 (klass=4143832320, recv=4143645140, id=3353, oid=4277134704, argc=1, argv=0xfeeff8c0, body=0xf6fdcacc, flags=0) at eval.c:5702 #32 0x0805c70b in rb_call (klass=4143832320, recv=4143645140, mid=3353, argc=1, argv=0xfeeff8c0, scope=0, self=4143827360) at eval.c:6094 #33 0x08058773 in rb_eval (self=4143827360, n=0x0) at ruby.h:679 #34 0x08059eaa in rb_eval (self=4143827360, n=0x0) at eval.c:3450 #35 0x0805dfaf in rb_yield_0 (val=42379, self=4143827360, klass=0, flags=-152037876, avalue=0) at eval.c:5021 #36 0x0805efca in rb_yield (val=4277134704) at eval.c:5105 #37 0x0807d64f in int_dotimes (num=56251) at numeric.c:2787 #38 0x0805c16e in rb_call0 (klass=4143813360, recv=56251, id=5473, oid=4277134704, argc=0, argv=0x0, body=0xf6fd9228, flags=0) at eval.c:5702 #39 0x0805c70b in rb_call (klass=4143813360, recv=56251, mid=5473, argc=0, argv=0x0, scope=0, self=4143827360) at eval.c:6094 #40 0x08058773 in rb_eval (self=4143827360, n=0x0) at ruby.h:679 #41 0x0805b3f7 in rb_eval (self=4143827360, n=0x0) at eval.c:3203 #42 0x0805dfaf in rb_yield_0 (val=3, self=4143827360, klass=0, flags=-152037596, avalue=0) at eval.c:5021 #43 0x0805efca in rb_yield (val=4277134704) at eval.c:5105 #44 0x0807d64f in int_dotimes (num=21) at numeric.c:2787 #45 0x0805c16e in rb_call0 (klass=4143813360, recv=21, id=5473, oid=4277134704, argc=0, argv=0x0, body=0xf6fd9228, flags=0) at eval.c:5702 #46 0x0805c70b in rb_call (klass=4143813360, recv=21, mid=5473, argc=0, argv=0x0, scope=0, self=4143827360) at eval.c:6094 #47 0x08058773 in rb_eval (self=4143827360, n=0x0) at ruby.h:679 #48 0x0805b3f7 in rb_eval (self=4143827360, n=0x0) at eval.c:3203 #49 0x0805a152 in rb_eval (self=4143827360, n=0x0) at eval.c:3127 #50 0x0806369c in ruby_exec_internal () at eval.c:1634 #51 0x080636cc in ruby_exec () at eval.c:1654 #52 0x080645eb in ruby_run () at eval.c:1664 #53 0x08052888 in main (argc=2, argv=0xfef02e44, envp=0xfef02e50) at main.c:48 ________________________________ From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Philippe Lang Sent: Thursday, September 25, 2008 1:58 AM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXTableItem.new segmentation fault Maybe you should try with FXRuby 1.6.14? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmelton at ball.com Thu Sep 25 14:00:02 2008 From: rmelton at ball.com (Melton, Ryan) Date: Thu, 25 Sep 2008 12:00:02 -0600 Subject: [fxruby-users] FXTableItem.new segmentation fault In-Reply-To: <6B90560780C80940BB5EE1D6650C2D75FF42AF@mail.tektone.net> References: <6B90560780C80940BB5EE1D6650C2D75FF42AF@mail.tektone.net> Message-ID: <2EC28B773AF39E47850AC45765483C2C026B2567@AEROMSG2.AERO.BALL.COM> FXRuby does not work with Ruby 1.8.7 due to a bug in SWIG. http://sourceforge.net/tracker/index.php?func=detail&aid=2034216&group_id=1645&atid=101645 Unfortunately the same ruby change that results in the "object allocation during garbage collection phase" made it into the Ruby 1.8.6 releases as well at around version 117. So to use FXRuby, you must use a version of Ruby 1.8.6 that is before r117. Yes, this sucks. Hopefully SWIG will be fixed soon, or Lyle will work around the issue like the wxRuby group did. Ryan ________________________________ From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Tim Smith Sent: Thursday, September 25, 2008 11:44 AM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXTableItem.new segmentation fault I've had it crash with FXRuby 1.6.14 on XP, Vista, and Linux. I've also had it crash with ruby 1.8.7 on Linux, with the same failed assertion (FXRuby.cpp:1472), and the message "object allocation during garbage collection phase". I'm including a tweaked version below which seems to crash more reliably within the first few minutes. I'm also including a backtrace below. It appears that during the initialization of an FXTableItem, FXRbRegisterRubyObj() was called to associate the Ruby object with the Fox object in FXRuby_Objects. But while this was happening, garbage collection occurred, causing FXRbTableItem::markfunc() to be called, which called getIcon(), which led to a lookup in FXRuby_Objects for the Ruby object which was still in the process of being inserted there. Tim Smith require 'fox16'; include Fox start = Time.now count = 0 items = [] while true 10.times {|j| items[j] = [] 28125.times {|i| items[j][i] = FXTableItem.new '' } } count += 1 puts "#{count}, after #{Time.now - start} seconds" end FXRuby.cpp:1472: FXASSERT(!NIL_P(obj)) failed. Breakpoint 1, rb_exc_raise (mesg=0) at eval.c:4616 4616 in eval.c (gdb) bt #0 rb_exc_raise (mesg=0) at eval.c:4616 #1 0x0805fb07 in rb_method_missing (argc=1, argv=0xfeefcff0, obj=4) at eval.c:5630 #2 0x0805c192 in rb_call0 (klass=4143832220, recv=4, id=3889, oid=4277134704, argc=1, argv=0xfeefcff0, body=0xf6fdc130, flags=2) at eval.c:5702 #3 0x0805c70b in rb_call (klass=4143832220, recv=4, mid=3889, argc=1, argv=0xfeefcff0, scope=1, self=6) at eval.c:6094 #4 0x0805cd4e in rb_funcall2 (recv=0, mid=3889, argc=1, argv=0xfeefcff0) at ruby.h:679 #5 0x0806008a in method_missing (obj=4, id=8311054, argc=0, argv=0x0, call_status=-17832592) at eval.c:5671 #6 0x0805c744 in rb_call (klass=4143829940, recv=4, mid=32465, argc=0, argv=0x0, scope=1, self=6) at eval.c:6090 #7 0x0805cfb6 in vafuncall (recv=4, mid=32465, n=0, ar=0xfeefd0f4) at ruby.h:679 #8 0x0805d0d2 in rb_funcall (recv=4277134704, mid=0, n=0) at eval.c:6188 #9 0xf6b274d7 in FXRbCallIconMethod (recv=0x9e511c0, func=32465) at FXRuby.cpp:1473 #10 0xf6b02dff in FXRbTableItem::getIcon (this=0x9e511c0) at impl.cpp:1011 #11 0xf6920945 in FXRbTableItem::markfunc (self=0x9e511c0) at markfuncs.cpp:517 #12 0x0806b672 in gc_mark_children (ptr=4129486760, lev=1) at gc.c:945 #13 0x0806bbca in mark_locations_array (x=0xfeefd9fc, n=5357) at gc.c:629 #14 0x0806be3e in garbage_collect () at gc.c:1368 #15 0x0806c7b2 in ruby_xmalloc (size=65708) at gc.c:103 #16 0x0806c96d in ruby_xcalloc (n=16427, size=65708) at gc.c:123 #17 0x080a9d35 in rehash (table=0x965ad78) at st.c:324 #18 0x080a9eb0 in st_insert (table=0x965ad78, key=166007232, value=166007264) at st.c:293 #19 0xf6b23c74 in FXRbRegisterRubyObj (rubyObj=4129486760, foxObj=0x9e511c0) at FXRuby.cpp:253 #20 0xf69b71c7 in _wrap_new_FXTableItem (argc=3, argv=0xfeefe630, self=4129486760) at table_wrap.cpp:846 #21 0x0805c192 in rb_call0 (klass=4143645140, recv=4129486760, id=73137, oid=4277134704, argc=3, argv=0xfeefe630, body=0xf6fafc34, flags=2) at eval.c:5702 #22 0x0805c70b in rb_call (klass=4143645140, recv=4129486760, mid=73137, argc=3, argv=0xfeefe630, scope=1, self=4129486760) at eval.c:6094 #23 0x08058773 in rb_eval (self=4129486760, n=0x0) at ruby.h:679 #24 0x08061bac in block_pass (self=4129486760, node=0xf635360c) at eval.c:8884 #25 0x08058d56 in rb_eval (self=4129486760, n=0x0) at eval.c:3189 #26 0x0805c06a in rb_call0 (klass=4143645140, recv=4129486760, id=2961, oid=4277134704, argc=0, argv=0xfeeff8c4, body=0xf63546c4, flags=2) at eval.c:5998 #27 0x0805c70b in rb_call (klass=4143645140, recv=4129486760, mid=2961, argc=1, argv=0xfeeff8c0, scope=1, self=6) at eval.c:6094 #28 0x0805ccfc in rb_funcall2 (recv=0, mid=2961, argc=1, argv=0xfeeff8c0) at ruby.h:679 #29 0x0805cd9a in rb_obj_call_init (obj=4129486760, argc=1, argv=0xfeeff8c0) at eval.c:7626 #30 0x0807f490 in rb_class_new_instance (argc=1, argv=0xfeeff8c0, klass=4143645140) at object.c:1594 #31 0x0805c192 in rb_call0 (klass=4143832320, recv=4143645140, id=3353, oid=4277134704, argc=1, argv=0xfeeff8c0, body=0xf6fdcacc, flags=0) at eval.c:5702 #32 0x0805c70b in rb_call (klass=4143832320, recv=4143645140, mid=3353, argc=1, argv=0xfeeff8c0, scope=0, self=4143827360) at eval.c:6094 #33 0x08058773 in rb_eval (self=4143827360, n=0x0) at ruby.h:679 #34 0x08059eaa in rb_eval (self=4143827360, n=0x0) at eval.c:3450 #35 0x0805dfaf in rb_yield_0 (val=42379, self=4143827360, klass=0, flags=-152037876, avalue=0) at eval.c:5021 #36 0x0805efca in rb_yield (val=4277134704) at eval.c:5105 #37 0x0807d64f in int_dotimes (num=56251) at numeric.c:2787 #38 0x0805c16e in rb_call0 (klass=4143813360, recv=56251, id=5473, oid=4277134704, argc=0, argv=0x0, body=0xf6fd9228, flags=0) at eval.c:5702 #39 0x0805c70b in rb_call (klass=4143813360, recv=56251, mid=5473, argc=0, argv=0x0, scope=0, self=4143827360) at eval.c:6094 #40 0x08058773 in rb_eval (self=4143827360, n=0x0) at ruby.h:679 #41 0x0805b3f7 in rb_eval (self=4143827360, n=0x0) at eval.c:3203 #42 0x0805dfaf in rb_yield_0 (val=3, self=4143827360, klass=0, flags=-152037596, avalue=0) at eval.c:5021 #43 0x0805efca in rb_yield (val=4277134704) at eval.c:5105 #44 0x0807d64f in int_dotimes (num=21) at numeric.c:2787 #45 0x0805c16e in rb_call0 (klass=4143813360, recv=21, id=5473, oid=4277134704, argc=0, argv=0x0, body=0xf6fd9228, flags=0) at eval.c:5702 #46 0x0805c70b in rb_call (klass=4143813360, recv=21, mid=5473, argc=0, argv=0x0, scope=0, self=4143827360) at eval.c:6094 #47 0x08058773 in rb_eval (self=4143827360, n=0x0) at ruby.h:679 #48 0x0805b3f7 in rb_eval (self=4143827360, n=0x0) at eval.c:3203 #49 0x0805a152 in rb_eval (self=4143827360, n=0x0) at eval.c:3127 #50 0x0806369c in ruby_exec_internal () at eval.c:1634 #51 0x080636cc in ruby_exec () at eval.c:1654 #52 0x080645eb in ruby_run () at eval.c:1664 #53 0x08052888 in main (argc=2, argv=0xfef02e44, envp=0xfef02e50) at main.c:48 ________________________________ From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Philippe Lang Sent: Thursday, September 25, 2008 1:58 AM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXTableItem.new segmentation fault Maybe you should try with FXRuby 1.6.14? This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Thu Sep 25 14:48:12 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 25 Sep 2008 13:48:12 -0500 Subject: [fxruby-users] FXTableItem.new segmentation fault In-Reply-To: <2EC28B773AF39E47850AC45765483C2C026B2567@AEROMSG2.AERO.BALL.COM> References: <6B90560780C80940BB5EE1D6650C2D75FF42AF@mail.tektone.net> <2EC28B773AF39E47850AC45765483C2C026B2567@AEROMSG2.AERO.BALL.COM> Message-ID: <57cf8f720809251148u4958269au5e22f1591c60753c@mail.gmail.com> On Thu, Sep 25, 2008 at 1:00 PM, Melton, Ryan wrote: > FXRuby does not work with Ruby 1.8.7 due to a bug in SWIG. > http://sourceforge.net/tracker/index.php?func=detail&aid=2034216&group_id=1645&atid=101645 > > Unfortunately the same ruby change that results in the "object allocation > during garbage collection phase" made it into the Ruby 1.8.6 releases as > well at around version 117. So to use FXRuby, you must use a version of > Ruby 1.8.6 that is before r117. I didn't realize that this "fix" also made it into Ruby 1.8.6. Wonderful. > Yes, this sucks. Hopefully SWIG will be fixed soon, or Lyle will work > around the issue like the wxRuby group did. I'll see what I can do. From tsmith at tektone.net Thu Sep 25 16:50:36 2008 From: tsmith at tektone.net (Tim Smith) Date: Thu, 25 Sep 2008 16:50:36 -0400 Subject: [fxruby-users] FXTableItem.new segmentation fault Message-ID: <6B90560780C80940BB5EE1D6650C2D75FF438E@mail.tektone.net> The SWIG issue may indeed affect only versions of Ruby from 1.8.7 and 1.8.6 patchlevel 117 onward. I only saw the "object allocation during garbage collection phase" message on Ruby 1.8.7. However, the FXTableItem.new crash predates those versions. The backtrace I posted was from ruby 1.8.6 (2007-09-24 patchlevel 111) [i686-linux]. And I have just now reproduced the crash on ruby 1.8.2 (2004-12-25) [i386-mswin32]. As I observed in my last message, it looks like this crash happens when garbage collection triggers a call to getIcon() during the initialization of an FXTableItem, before the item is fully inserted into FXRuby_Objects. This problem goes back to at least Ruby 1.8.2 and FXRuby 1.6.14. Tim Smith -----Original Message----- From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Lyle Johnson Sent: Thursday, September 25, 2008 2:48 PM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXTableItem.new segmentation fault On Thu, Sep 25, 2008 at 1:00 PM, Melton, Ryan wrote: > FXRuby does not work with Ruby 1.8.7 due to a bug in SWIG. > http://sourceforge.net/tracker/index.php?func=detail&aid=2034216&group_i d=1645&atid=101645 > > Unfortunately the same ruby change that results in the "object allocation > during garbage collection phase" made it into the Ruby 1.8.6 releases as > well at around version 117. So to use FXRuby, you must use a version of > Ruby 1.8.6 that is before r117. I didn't realize that this "fix" also made it into Ruby 1.8.6. Wonderful. > Yes, this sucks. Hopefully SWIG will be fixed soon, or Lyle will work > around the issue like the wxRuby group did. I'll see what I can do. _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users From dwilde1 at gmail.com Fri Sep 26 22:09:34 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Fri, 26 Sep 2008 21:09:34 -0500 Subject: [fxruby-users] Multiple feeds to one data target Message-ID: Hi, folks - Having some amazing fun with FXRuby, but not getting all the way there despite Lyle's docs and book. Please see extracted example in DATA following __END__. I'm constructing a tab page of a block of TextFields plus sliders in construct_slider, but I don't have the info-passing correct yet. I can trigger the puts with any SEL_COMMAND, but I'm not getting data back. I don't get the value from the #{@in_vals[ targ ].value }, nor do I get updated screen contents. Please help an FXR noob get it right. All help appreciated!!! -- Don __END__ class VMDemoWindow < FXMainWindow def initialize( app ) image = VMImage.new( "wildebeest.jpg" ) @in_vals = { :u_1 => FXDataTarget.new } super( app, "Statistics Tool", :width => 550, :height => 450 ) splitter = FXSplitter.new( self, :opts => SPLITTER_HORIZONTAL|LAYOUT_FILL ) data_view = FXTabBook.new(splitter, :opts => LAYOUT_FILL ) image_view = VMImageView.new( splitter, image ) used_tab = FXTabItem.new( data_view, " % Used " ) used_page = FXHorizontalFrame.new( data_view, :opts => FRAME_RAISED | LAYOUT_FILL | PACK_UNIFORM_WIDTH ) construct_used_page( used_page ) end def construct_used_page( page ) construct_slider( page, :u_1, "usage" ) end def construct_slider( p, targ, str ) s = FXVerticalFrame.new( p, :opts => FRAME_RAISED | LAYOUT_FILL ) FXTextField.new( s, 3, :target => @in_vals[ targ ], :selector => FXDataTarget::ID_VALUE, :opts => TEXTFIELD_NORMAL|LAYOUT_FILL_X ) do | t | t.justify = JUSTIFY_CENTER_X | JUSTIFY_CENTER_Y t.tipText = "Value for " + str end FXSlider.new( s, @in_vals[ targ ], :selector => FXDataTarget::ID_VALUE, :opts => SLIDER_VERTICAL | SLIDER_TICKS_LEFT | LAYOUT_FILL ) do | aSlider | aSlider.range = Range.new( 1,.100 ) aSlider.increment = 1 aSlider.tickDelta = 10 aSlider.tipText = "Value for " + str aSlider.height = 100 aSlider.slotSize = 10 aSlider.padTop = 10 aSlider.padBottom = 10 end @in_vals[ targ ].connect( SEL_COMMAND ) do | sender, sel, data | puts "\"#{ str }\" is now #{ @in_vals[ targ ].value }." end end end -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Tue Sep 30 21:17:23 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 30 Sep 2008 20:17:23 -0500 Subject: [fxruby-users] Multiple feeds to one data target In-Reply-To: References: Message-ID: <9033A9A8-C74C-4D28-968B-39123CA2E592@lylejohnson.name> On Sep 26, 2008, at 9:09 PM, Don Wilde wrote: > Please see extracted example in DATA following __END__. I'm > constructing a tab page of a block of TextFields plus sliders in > construct_slider, but I don't have the info-passing correct yet. I > can trigger the puts with any SEL_COMMAND, but I'm not getting data > back. I don't get the value from the #{@in_vals[ targ ].value }, nor > do I get updated screen contents. I've had to make some substitutions since the code you sent doesn't run (missing classes VMImage and VMImageFrame), but I think the main problem is that you never initialized the data target to any particular value. The main change I made was just to initialize it to 0.5 (arbitrarily picked): @in_vals = { :u_1 => FXDataTarget.new(0.5) } When I do this, both the text field and the slider start out with this value, and changing either the text field or slider value updates the data target's value as expected. Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby From dwilde1 at gmail.com Tue Sep 30 21:57:49 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Tue, 30 Sep 2008 20:57:49 -0500 Subject: [fxruby-users] Multiple feeds to one data target In-Reply-To: <9033A9A8-C74C-4D28-968B-39123CA2E592@lylejohnson.name> References: <9033A9A8-C74C-4D28-968B-39123CA2E592@lylejohnson.name> Message-ID: Lyle - Bingo, you've got it. On Tue, Sep 30, 2008 at 8:17 PM, Lyle Johnson wrote: > > On Sep 26, 2008, at 9:09 PM, Don Wilde wrote: > > Please see extracted example in DATA following __END__. I'm constructing a >> tab page of a block of TextFields plus sliders in construct_slider, but I >> don't have the info-passing correct yet. I can trigger the puts with any >> SEL_COMMAND, but I'm not getting data back. I don't get the value from the >> #{@in_vals[ targ ].value }, nor do I get updated screen contents. >> > > I've had to make some substitutions since the code you sent doesn't run > (missing classes VMImage and VMImageFrame), but I think the main Apologies. I stripped a lot more, should have left enough to let it run. problem is that you never initialized the data target to any particular > value. The main change I made was just to initialize it to 0.5 (arbitrarily > picked): > > @in_vals = { > :u_1 => FXDataTarget.new(0.5) > } > You bet, that did it. Thank you!!! :D > > When I do this, both the text field and the slider start out with this > value, and changing either the text field or slider value updates the data > target's value as expected. > > Hope this helps, > > Lyle > > --- > "FXRuby: Create Lean and Mean GUIs with Ruby" > Now available from the Pragmatic Bookshelf! > http://www.pragprog.com/titles/fxruby > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: