From dwilde1 at gmail.com Sat Nov 1 10:59:48 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Sat, 1 Nov 2008 09:59:48 -0500 Subject: [fxruby-users] query fxruby doc by ri In-Reply-To: <72447.10037.qm@web36805.mail.mud.yahoo.com> References: <72447.10037.qm@web36805.mail.mud.yahoo.com> Message-ID: On Fri, Oct 31, 2008 at 10:09 AM, chen li wrote: > Hi all, > > I cannot search fxruby and its classes by ri. I wonder how to fix it. > > Thanks, > > Li ri Fox::FXApp | less -- :D -------------- next part -------------- An HTML attachment was scrubbed... URL: From chen_li3 at yahoo.com Sat Nov 1 14:33:53 2008 From: chen_li3 at yahoo.com (chen li) Date: Sat, 1 Nov 2008 11:33:53 -0700 (PDT) Subject: [fxruby-users] query FXRuby by ri Message-ID: <604216.23373.qm@web36803.mail.mud.yahoo.com> Hi Don, Thanks for the tips. But it works on an old XP computer but NOT on the new Vista. I also notice that I can browse the classes from Fxruby when I use fxri or ri on the old computer. I see nothing about FxRuby's stuff when I use fxri or ri on the new Vista. But I can use gem server to see the Rdoc about FxRuby's classes on both computers. It looks Ruby doesn't know that FxRuby's RDoc is there. Is there any way to fix it? Thanks, Li ################################################# C:\Users\Alex>ri Fox::FXApp Nothing known about Fox::FXApp C:\Users\Alex>ri Fox.FXApp Nothing known about Fox.FXApp From dwilde1 at gmail.com Sat Nov 1 14:53:11 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Sat, 1 Nov 2008 13:53:11 -0500 Subject: [fxruby-users] query FXRuby by ri In-Reply-To: <604216.23373.qm@web36803.mail.mud.yahoo.com> References: <604216.23373.qm@web36803.mail.mud.yahoo.com> Message-ID: On Sat, Nov 1, 2008 at 1:33 PM, chen li wrote: > Hi Don, > > Thanks for the tips. > > But it works on an old XP computer but NOT on the new Vista. > > I also notice that I can browse the classes from Fxruby when I use fxri or > ri on the old computer. I see nothing about FxRuby's stuff when I use fxri > or ri on the new Vista. But I can use gem server to see the Rdoc about > FxRuby's classes on both computers. It looks Ruby doesn't know that FxRuby's > RDoc is there. Is there any way to fix it? No idea, sorry! I'm not going to waste my precious CPU cycles on Vista until I absolutely have to and it pays me good money to... so I can buy more FreeBSD and Linux computers. -- :D Good luck, though! -------------- next part -------------- An HTML attachment was scrubbed... URL: From chen_li3 at yahoo.com Sat Nov 1 15:35:32 2008 From: chen_li3 at yahoo.com (chen li) Date: Sat, 1 Nov 2008 12:35:32 -0700 (PDT) Subject: [fxruby-users] query FXRuby by ri In-Reply-To: Message-ID: <77415.26997.qm@web36806.mail.mud.yahoo.com> > > The old xp is a shared one and the new Vista is owned > by myself. > > > > Li > > > > > > So, do you like it? The problem is sovled as following by typing the command line in the prompt window: gem rdoc fxruby It looks like 'gem install fxruby' only installs the rdoc for IE explorer but not rdoc for ri. As for Vista--Yes, I like it. Li From migatine at gmail.com Sat Nov 1 16:05:50 2008 From: migatine at gmail.com (=?ISO-8859-1?Q?Mich=E8le_Garoche?=) Date: Sat, 1 Nov 2008 21:05:50 +0100 Subject: [fxruby-users] Warning on kwargs on launch Message-ID: <7B566F89-1C93-4F54-B58C-994C8F5CEE3E@gmail.com> Hello, I've got this warning: /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb: 82: warning: redefine listFonts when launching an FXRuby application. Is there anything I could changee in kwargs.rb to get rid of it. Computer: iMac flat G4, running Mac OS X 10.4.1 Fox version: 1.6.34 Thanks in advance for any hint. Cheers, Mich?le -------------- next part -------------- An HTML attachment was scrubbed... URL: From chen_li3 at yahoo.com Sat Nov 1 18:12:28 2008 From: chen_li3 at yahoo.com (chen li) Date: Sat, 1 Nov 2008 15:12:28 -0700 (PDT) Subject: [fxruby-users] how to change a button's text one by one Message-ID: <628378.96583.qm@web36804.mail.mud.yahoo.com> Hi all, I create 3 buttons. If I click @button_start , at button_word will change its text one by one based on an array. If I click @button_end the program will end. My problem here is that the word on @button_word doesn't change one by one, instead they all show up at the same time. Any idea? Thanks, Li ################################################### #create 3 buttons @button_start=FXButton.new(self,'start') @button_end=FXButton.new(self,'end') @button_word=FXButton.new(self,'reading words') # change the text on @button_word one by one slice=%w{A,B,C,D,E} @button_start.connect(SEL_COMMAND) do|sender,selector,data| slice.each do |letter| @button_word.text=letter sleep 2 end end @button_end.connect(SEL_COMMAND) do|sender,selector,data| exit end From lyle at lylejohnson.name Sat Nov 1 19:29:55 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Sat, 1 Nov 2008 18:29:55 -0500 Subject: [fxruby-users] how to change a button's text one by one In-Reply-To: <628378.96583.qm@web36804.mail.mud.yahoo.com> References: <628378.96583.qm@web36804.mail.mud.yahoo.com> Message-ID: <659B017D-609E-4FCA-8A32-D1370A28F442@lylejohnson.name> On Nov 1, 2008, at 5:12 PM, chen li wrote: > I create 3 buttons. If I click @button_start , at button_word will > change its text one by one based on an array. If I click @button_end > the program will end. My problem here is that the word on > @button_word doesn't change one by one, instead they all show up at > the same time. Your definition of "slice" is an array containing one element: slice = %w{A,B,C,D,E} This evaluates to an array with one element, whose value is the string "A,B,C,D,E". I think what you're going for is: slice = %w{A B C D E} or just: slice = ["A", "B", "C", "D", "E"] Hope this helps, Lyle From lyle at lylejohnson.name Sat Nov 1 19:32:30 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Sat, 1 Nov 2008 18:32:30 -0500 Subject: [fxruby-users] Warning on kwargs on launch In-Reply-To: <7B566F89-1C93-4F54-B58C-994C8F5CEE3E@gmail.com> References: <7B566F89-1C93-4F54-B58C-994C8F5CEE3E@gmail.com> Message-ID: <7FE99917-91A5-40C9-93F1-17960F4B1A19@lylejohnson.name> On Nov 1, 2008, at 3:05 PM, Mich?le Garoche wrote: > Hello, > > I've got this warning: > > /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb: > 82: warning: redefine listFonts > > when launching an FXRuby application. > > Is there anything I could changee in kwargs.rb to get rid of it? Run Ruby without warnings turned on (i.e. don't pass the "-w" flag to ruby). I'm not sure why they've chosen to tag redefining methods as a warning, but there's not much we can do about it. 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: From migatine at gmail.com Sat Nov 1 22:29:16 2008 From: migatine at gmail.com (=?ISO-8859-1?Q?Mich=E8le_Garoche?=) Date: Sun, 2 Nov 2008 03:29:16 +0100 Subject: [fxruby-users] Warning on kwargs on launch In-Reply-To: <7FE99917-91A5-40C9-93F1-17960F4B1A19@lylejohnson.name> References: <7B566F89-1C93-4F54-B58C-994C8F5CEE3E@gmail.com> <7FE99917-91A5-40C9-93F1-17960F4B1A19@lylejohnson.name> Message-ID: <4788A4DF-5DF8-4A00-B047-5FE9DEA34FFF@gmail.com> Le 2 nov. 2008 ? 00:32, Lyle Johnson a ?crit : > > On Nov 1, 2008, at 3:05 PM, Mich?le Garoche wrote: > >> Hello, >> >> I've got this warning: >> >> /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/ >> kwargs.rb:82: warning: redefine listFonts >> >> when launching an FXRuby application. >> >> Is there anything I could changee in kwargs.rb to get rid of it? > > Run Ruby without warnings turned on (i.e. don't pass the "-w" flag > to ruby). I'm not sure why they've chosen to tag redefining methods > as a warning, but there's not much we can do about it. > > Hope this helps, Yes, sure, so simple. Thank you very much. Cheers, Mich?le -------------- next part -------------- An HTML attachment was scrubbed... URL: From soumyanath.c at gmail.com Sun Nov 2 09:16:01 2008 From: soumyanath.c at gmail.com (Soumyanath) Date: Sun, 02 Nov 2008 19:46:01 +0530 Subject: [fxruby-users] how to change a button's text one by one In-Reply-To: <628378.96583.qm@web36804.mail.mud.yahoo.com> References: <628378.96583.qm@web36804.mail.mud.yahoo.com> Message-ID: <490DB621.7050803@gmail.com> Hi Chen, I suggest you use timer to show the text. chen li wrote: > Hi all, > > > I create 3 buttons. If I click @button_start , at button_word will change its text one by one based on an array. If I click @button_end the program will end. My problem here is that the word on @button_word doesn't change one by one, instead they all show up at the same time. > > Any idea? > > > Thanks, > > Li > > > ################################################### > #create 3 buttons > @button_start=FXButton.new(self,'start') > @button_end=FXButton.new(self,'end') > @button_word=FXButton.new(self,'reading words') > > # change the text on @button_word one by one > slice=%w{A,B,C,D,E} > > @button_start.connect(SEL_COMMAND) do|sender,selector,data| > slice.each do |letter| > @button_word.text=letter > sleep 2 > end > > end > > > > > > @button_end.connect(SEL_COMMAND) do|sender,selector,data| > exit > > end -- Regards Soumyanath Chatterjee [http://www.soumya.name] Question _your own_ authority. From chen_li3 at yahoo.com Sun Nov 2 10:35:55 2008 From: chen_li3 at yahoo.com (chen li) Date: Sun, 2 Nov 2008 07:35:55 -0800 (PST) Subject: [fxruby-users] how to change a button's text one by one In-Reply-To: <659B017D-609E-4FCA-8A32-D1370A28F442@lylejohnson.name> Message-ID: <980702.81627.qm@web36804.mail.mud.yahoo.com> Hi Lyle, I change to slice = ["A", "B", "C", "D", "E"]. But strange thing still happens: I can see the button change to the last item 'E' from 'reading word', but not to the other itmes of A , B, C, D. Another question: I read API about FXButton. There are no instance methods such as #text in this class. But when I query Ruby on it by code line: button.public_methods.size it return 414 methods. Where are these methods defined, by their ancestors and mixins? Thanks, Li From rmelton at ball.com Mon Nov 3 10:36:35 2008 From: rmelton at ball.com (Melton, Ryan) Date: Mon, 3 Nov 2008 08:36:35 -0700 Subject: [fxruby-users] Warning on kwargs on launch In-Reply-To: <7FE99917-91A5-40C9-93F1-17960F4B1A19@lylejohnson.name> References: <7B566F89-1C93-4F54-B58C-994C8F5CEE3E@gmail.com> <7FE99917-91A5-40C9-93F1-17960F4B1A19@lylejohnson.name> Message-ID: <2EC28B773AF39E47850AC45765483C2C026B263F@AEROMSG2.AERO.BALL.COM> It easy to remove redefinition warnings. Just wrap the redefinition like so: $VERBOSE = nil def redefined_method ... end $VERBOSE = true This disables ruby warnings for that section. Ryan ________________________________ From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Lyle Johnson Sent: Saturday, November 01, 2008 5:33 PM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] Warning on kwargs on launch On Nov 1, 2008, at 3:05 PM, Mich?le Garoche wrote: Hello, I've got this warning: /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb:82: warning: redefine listFonts when launching an FXRuby application. Is there anything I could changee in kwargs.rb to get rid of it? Run Ruby without warnings turned on (i.e. don't pass the "-w" flag to ruby). I'm not sure why they've chosen to tag redefining methods as a warning, but there's not much we can do about it. Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby 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 Mon Nov 3 10:53:25 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 3 Nov 2008 09:53:25 -0600 Subject: [fxruby-users] Warning on kwargs on launch In-Reply-To: <2EC28B773AF39E47850AC45765483C2C026B263F@AEROMSG2.AERO.BALL.COM> References: <7B566F89-1C93-4F54-B58C-994C8F5CEE3E@gmail.com> <7FE99917-91A5-40C9-93F1-17960F4B1A19@lylejohnson.name> <2EC28B773AF39E47850AC45765483C2C026B263F@AEROMSG2.AERO.BALL.COM> Message-ID: <57cf8f720811030753r532cccfem860e8b2c8c05d92b@mail.gmail.com> On Mon, Nov 3, 2008 at 9:36 AM, Melton, Ryan wrote: > It easy to remove redefinition warnings. Just wrap the redefinition like > so: > > $VERBOSE = nil > > def redefined_method > ? > end > > $VERBOSE = true > > This disables ruby warnings for that section. Thanks! That I can do. I like this a lot better than just disabling warnings altogether. From migatine at gmail.com Mon Nov 3 11:04:49 2008 From: migatine at gmail.com (=?ISO-8859-1?Q?Mich=E8le_Garoche?=) Date: Mon, 3 Nov 2008 17:04:49 +0100 Subject: [fxruby-users] Warning on kwargs on launch In-Reply-To: <2EC28B773AF39E47850AC45765483C2C026B263F@AEROMSG2.AERO.BALL.COM> References: <7B566F89-1C93-4F54-B58C-994C8F5CEE3E@gmail.com> <7FE99917-91A5-40C9-93F1-17960F4B1A19@lylejohnson.name> <2EC28B773AF39E47850AC45765483C2C026B263F@AEROMSG2.AERO.BALL.COM> Message-ID: <2CC84C29-E34B-4347-B62F-7FEB5E2A9967@gmail.com> Thank you very much Ryan, I prefer this solution than to disable warning (which I've not done). Le 3 nov. 2008 ? 16:36, Melton, Ryan a ?crit : > It easy to remove redefinition warnings. Just wrap the > redefinition like so: > > > > $VERBOSE = nil > > > > def redefined_method > > ? > > end > > > > $VERBOSE = true > > > > This disables ruby warnings for that section. > > > > Ryan > > > > From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users- > bounces at rubyforge.org] On Behalf Of Lyle Johnson > Sent: Saturday, November 01, 2008 5:33 PM > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] Warning on kwargs on launch > > > > > > On Nov 1, 2008, at 3:05 PM, Mich?le Garoche wrote: > > > > > Hello, > > > > I've got this warning: > > > > /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.16/lib/fox16/kwargs.rb: > 82: warning: redefine listFonts > > > > when launching an FXRuby application. > > > > Is there anything I could changee in kwargs.rb to get rid of it? > > > > Run Ruby without warnings turned on (i.e. don't pass the "-w" flag > to ruby). I'm not sure why they've chosen to tag redefining methods > as a warning, but there's not much we can do about it. > > > > Hope this helps, > > > > Lyle > > > > --- > > "FXRuby: Create Lean and Mean GUIs with Ruby" > > Now available from the Pragmatic Bookshelf! > > http://www.pragprog.com/titles/fxruby > > > > > > > > > > > > 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. > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users Cheers, Mich?le ? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 36C471DED4B09EEB30A0281F2608DB2FE6F9E147.gpgkey Type: application/octet-stream Size: 1744 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From angico at angico.org Wed Nov 5 11:40:21 2008 From: angico at angico.org (angico) Date: Wed, 05 Nov 2008 13:40:21 -0300 Subject: [fxruby-users] capturing stdout, stdin and stderr Message-ID: <1225903221.6495.50.camel@caipora> Hi, All. Is there any tutorial out there on capturing the standard streams (in, out, err) so that we can have an external command (say, scp) display output in a window and get input from user with a dialog box? Thanks, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From meinrad.recheis at gmail.com Wed Nov 5 14:02:15 2008 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Wed, 5 Nov 2008 20:02:15 +0100 Subject: [fxruby-users] capturing stdout, stdin and stderr In-Reply-To: <1225903221.6495.50.camel@caipora> References: <1225903221.6495.50.camel@caipora> Message-ID: <43d756720811051102g6610a5b2na9e7b5013fd4981d@mail.gmail.com> afaik, something like that could be done via IO.popen ... somebody correct me if i'm wrong.-- henon On Wed, Nov 5, 2008 at 5:40 PM, angico wrote: > Hi, All. > > Is there any tutorial out there on capturing the standard streams (in, > out, err) so that we can have an external command (say, scp) display > output in a window and get input from user with a dialog box? > > Thanks, > > -- > > angico > ------ > home page: www.angico.org > Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I > ------ > contatos: > email: angico at angico.org > skype: an.gi.co > ------ > > _______________________________________________ > 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 rovshanb at gmail.com Thu Nov 6 00:16:08 2008 From: rovshanb at gmail.com (Rovshan Baghirov) Date: Thu, 6 Nov 2008 09:16:08 +0400 Subject: [fxruby-users] capturing stdout, stdin and stderr In-Reply-To: <1225903221.6495.50.camel@caipora> References: <1225903221.6495.50.camel@caipora> Message-ID: <2427e580811052116y546a878bh228a578cfc18d2f5@mail.gmail.com> Example from Programming Ruby book: pig = IO.popen("/usr/local/bin/pig", "w+") pig.puts "ice cream after they go to bed" pig.close_write puts pig.gets On Wed, Nov 5, 2008 at 8:40 PM, angico wrote: > Hi, All. > > Is there any tutorial out there on capturing the standard streams (in, > out, err) so that we can have an external command (say, scp) display > output in a window and get input from user with a dialog box? > > Thanks, > > -- > > angico > ------ > home page: www.angico.org > Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I > ------ > contatos: > email: angico at angico.org > skype: an.gi.co > ------ > > _______________________________________________ > 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 angico at angico.org Thu Nov 6 03:59:56 2008 From: angico at angico.org (angico) Date: Thu, 06 Nov 2008 05:59:56 -0300 Subject: [fxruby-users] capturing stdout, stdin and stderr In-Reply-To: <2427e580811052116y546a878bh228a578cfc18d2f5@mail.gmail.com> References: <1225903221.6495.50.camel@caipora> <2427e580811052116y546a878bh228a578cfc18d2f5@mail.gmail.com> Message-ID: <1225961996.6495.81.camel@caipora> Em Qui, 2008-11-06 ?s 09:16 +0400, Rovshan Baghirov escreveu: > Example from Programming Ruby book: > > pig = IO.popen("/usr/local/bin/pig", "w+") > pig.puts "ice cream after they go to bed" > pig.close_write > puts pig.gets Thank you, guys. I guess it's a starting point. But what I really need is to have an application's stdin "connected" to an FXInputDialog, in order to get user input, instead of the console. Let's say I want to create a front-end to scp. The user will enter the name of the host and the full filename in a dialog. Then I pass in these data to scp through, say, popen. Ok. Then, scp will need to ask the user for their password. Instead of the console asking the user to enter that password, I'd like to catch this (including the message "angico at 192.168.1.3's password: ") and present them to the user in an FXInputDialog. I'm not sure if I'm being clear. Anyway, does anybody know how can I achieve this? Any idea? Any tutorial? Thanks, again, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From jeroen at fox-toolkit.org Thu Nov 6 08:13:33 2008 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Thu, 6 Nov 2008 08:13:33 -0500 Subject: [fxruby-users] capturing stdout, stdin and stderr In-Reply-To: <1225961996.6495.81.camel@caipora> References: <1225903221.6495.50.camel@caipora> <2427e580811052116y546a878bh228a578cfc18d2f5@mail.gmail.com> <1225961996.6495.81.camel@caipora> Message-ID: <200811060713.34437.jeroen@fox-toolkit.org> On Thursday 06 November 2008, angico wrote: > Em Qui, 2008-11-06 ?s 09:16 +0400, Rovshan Baghirov escreveu: > > Example from Programming Ruby book: > > > > pig = IO.popen("/usr/local/bin/pig", "w+") > > pig.puts "ice cream after they go to bed" > > pig.close_write > > puts pig.gets > > Thank you, guys. I guess it's a starting point. > > But what I really need is to have an application's stdin "connected" to > an FXInputDialog, in order to get user input, instead of the console. > > Let's say I want to create a front-end to scp. The user will enter the > name of the host and the full filename in a dialog. Then I pass in these > data to scp through, say, popen. Ok. Then, scp will need to ask the user > for their password. Instead of the console asking the user to enter that > password, I'd like to catch this (including the message > "angico at 192.168.1.3's password: ") and present them to the user in an > FXInputDialog. I'm not sure if I'm being clear. > > Anyway, does anybody know how can I achieve this? Any idea? Any > tutorial? > > Thanks, again, > You can open two pipes and pass these along as stdin and stdout of the program you're starting: pipe(in); pipe(out); pid=fork(); if(pid==0){ ::close(out[0]); ::dup2(out[1],STDOUT_FILENO); ::close(in[1]); ::dup2(in[0],STDIN_FILENO); ::execl(path,...,NULL); ::exit(1); } else if(pid>0){ ::close(out[1]); ::close(in[0]); getApp()->addInput(obj,ID_INPUTREAD,out[0],INPUT_READ,(void*)(FXival)out[0]); } In a nutshell. There are details omitted for brevity's sake. The handler for ID_INPUT_READ will get invoked when the program "path" writes to stdout. It will then have to present this text to the user and write to in[1] to talk back to the program (using write()). Hope this helps, - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 07:00 11/ 6/2008 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ From dwilde1 at gmail.com Thu Nov 6 13:01:25 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Thu, 6 Nov 2008 12:01:25 -0600 Subject: [fxruby-users] resizing main window on the fly Message-ID: Hi, all - Is it possible to resize the main window on the fly? I want to default to an 800x600 window but give the user an option to resize to 1024. This approach didn't work: class MyWindow < FXMainWindow def initialize( app ) #... @mainWindowWidth = 800 # Build the overall Application GUI # --------------------------------- super( app, " MyWindow ", :width => @mainWindowWidth, :height => 600, :vSpacing => 0 ) #... winWidth = FXListBox.new( blk1, :opts => LISTBOX_NORMAL ) winWidth.appendItem("800") winWidth.appendItem("1024") winWidth.connect( SEL_COMMAND ) do | sender, sel, data | @mainWindowWidth = data.to_i app.forceRefresh end end end #... if __FILE__ == $0 FXApp.new do | app | FXToolTip.new( app ) gui = MyWindow.new( app ) app.create app.run end end My fallback is to save to a file and load the value on the next start, but is that necessary? Another question, is this discussion list archived and visible anywhere? Lyle, your time is better spent coding than answering the same questions more than once. :))) -- :D -------------- next part -------------- An HTML attachment was scrubbed... URL: From angico at angico.org Thu Nov 6 13:38:46 2008 From: angico at angico.org (angico) Date: Thu, 06 Nov 2008 15:38:46 -0300 Subject: [fxruby-users] capturing stdout, stdin and stderr In-Reply-To: <200811060713.34437.jeroen@fox-toolkit.org> References: <1225903221.6495.50.camel@caipora> <2427e580811052116y546a878bh228a578cfc18d2f5@mail.gmail.com> <1225961996.6495.81.camel@caipora> <200811060713.34437.jeroen@fox-toolkit.org> Message-ID: <1225996726.6495.98.camel@caipora> Em Qui, 2008-11-06 ?s 08:13 -0500, Jeroen van der Zijp escreveu: > You can open two pipes and pass these along as stdin and stdout of the > program you're starting: > > pipe(in); > pipe(out); > > pid=fork(); > > if(pid==0){ > ::close(out[0]); > ::dup2(out[1],STDOUT_FILENO); > ::close(in[1]); > ::dup2(in[0],STDIN_FILENO); > ::execl(path,...,NULL); > ::exit(1); > } > else if(pid>0){ > ::close(out[1]); > ::close(in[0]); > getApp()->addInput(obj,ID_INPUTREAD,out[0],INPUT_READ,(void*)(FXival)out[0]); > } > > In a nutshell. There are details omitted for brevity's sake. > > The handler for ID_INPUT_READ will get invoked when the program "path" writes to > stdout. It will then have to present this text to the user and write to in[1] > to talk back to the program (using write()). > > Hope this helps, > > - Jeroen > Yeah! That's exactly what I was looking for. Thank you very much! -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From angico at angico.org Thu Nov 6 14:53:30 2008 From: angico at angico.org (angico) Date: Thu, 06 Nov 2008 16:53:30 -0300 Subject: [fxruby-users] resizing main window on the fly In-Reply-To: References: Message-ID: <1226001210.6495.106.camel@caipora> Em Qui, 2008-11-06 ?s 12:01 -0600, Don Wilde escreveu: > Hi, all - > > Is it possible to resize the main window on the fly? I want to default > to an 800x600 window but give the user an option to resize to 1024. > > This approach didn't work: > > class MyWindow < FXMainWindow > def initialize( app ) > #... > > @mainWindowWidth = 800 > > # Build the overall Application GUI > # --------------------------------- > super( app, > " MyWindow ", > :width => @mainWindowWidth, :height => 600, :vSpacing => > 0 ) > #... > winWidth = FXListBox.new( blk1, :opts => LISTBOX_NORMAL ) > winWidth.appendItem("800") > winWidth.appendItem("1024") > winWidth.connect( SEL_COMMAND ) do | sender, sel, data | > @mainWindowWidth = data.to_i > app.forceRefresh > end > end > end > #... When you say @mainWindowWidth = data.to_i you're just assigning variable @mainWindowWidth a new value. It has nothing to do with the application's main window's width. Instead, try: winWidth.connect( SEL_COMMAND ) do | sender, sel, data | resize(data.to_i, height) end Hope this helps. -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From dwilde1 at gmail.com Thu Nov 6 21:19:36 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Thu, 6 Nov 2008 20:19:36 -0600 Subject: [fxruby-users] resizing main window on the fly In-Reply-To: <1226001210.6495.106.camel@caipora> References: <1226001210.6495.106.camel@caipora> Message-ID: On Thu, Nov 6, 2008 at 1:53 PM, angico wrote: > Em Qui, 2008-11-06 ?s 12:01 -0600, Don Wilde escreveu: > > Hi, all - > > > > Is it possible to resize the main window on the fly? I want to default > > to an 800x600 window but give the user an option to resize to 1024. > > > > This approach didn't work: > > > [snip] When you say @mainWindowWidth = data.to_i you're just assigning variable > @mainWindowWidth a new value. It has nothing to do with the > application's main window's width. > > Instead, try: > > winWidth.connect( SEL_COMMAND ) do | sender, sel, data | > resize(data.to_i, height) > end > > > Hope this helps. Hi, Angico - You definitely put me on the right track. One further refinement necessary, for the record. FXListBox returns a zero-based index into the list, not the text. FXComboBox (according to Lyle) can be inspected with sender.text, but FXListBox is a bit more primitive. My working solution, retaining the variable so I can intelligently size and position things: availWinWidths = Array["800", "1024"] winWidth = FXListBox.new( blk1, :opts => LISTBOX_NORMAL ) availWinWidths.each { | w | winWidth.appendItem( w ) } winWidth.connect( SEL_COMMAND ) do | sender, sel, data | wSel = availWinWidths[ data.to_i ] @mainWindowWidth = wSel.to_i resize(@mainWindowWidth, 600 ) end It works marvelously well. Thank you for the big nudge in the right direction! -- :D -------------- next part -------------- An HTML attachment was scrubbed... URL: From angico at angico.org Fri Nov 7 03:30:39 2008 From: angico at angico.org (angico) Date: Fri, 07 Nov 2008 05:30:39 -0300 Subject: [fxruby-users] resizing main window on the fly In-Reply-To: References: <1226001210.6495.106.camel@caipora> Message-ID: <1226046639.6495.119.camel@caipora> Em Qui, 2008-11-06 ?s 20:19 -0600, Don Wilde escreveu: > > Hi, Angico - > > > You definitely put me on the right track. > > One further refinement necessary, for the record. > > FXListBox returns a zero-based index into the list, not the text. > FXComboBox (according to Lyle) can be inspected with sender.text, but > FXListBox is a bit more primitive. > > > My working solution, retaining the variable so I can intelligently > size and position things: > > availWinWidths = Array["800", "1024"] > winWidth = FXListBox.new( blk1, :opts => LISTBOX_NORMAL ) > availWinWidths.each { | w | winWidth.appendItem( w ) } > winWidth.connect( SEL_COMMAND ) do | sender, sel, data | > wSel = availWinWidths[ data.to_i ] > @mainWindowWidth = wSel.to_i > resize(@mainWindowWidth, 600 ) > end > > It works marvelously well. Thank you for the big nudge in the right > direction! > I don't get the point you insist in using that @mainWindowWidth, when you could just use width. On the other hand, you could simplify the whole above to the following: ### winWidth = FXListBox.new(blk1, :opts => LISTBOX_NORMAL) [800, 1024].each { |w| winWidth.appendItem(w) } winWindth.connect(SEL_COMMAND) do |sender, selector, data| resize(winWidth.getItemText.to_i, height) end ### This could save you some typing and looks (at least to me) more readable. Here "height" is actually a method from FXWindow, which returns the current height of this window's instance. The same is true for "width", so you wouldn't need to store the window's current width in an external variable. Regards, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I ------ contatos: email: angico at angico.org skype: an.gi.co ------ From dwilde1 at gmail.com Fri Nov 7 08:45:23 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Fri, 7 Nov 2008 07:45:23 -0600 Subject: [fxruby-users] resizing main window on the fly In-Reply-To: <1226046639.6495.119.camel@caipora> References: <1226001210.6495.106.camel@caipora> <1226046639.6495.119.camel@caipora> Message-ID: [snip] > > > I don't get the point you insist in using that @mainWindowWidth, when > you could just use width. > > On the other hand, you could simplify the whole above to the following: > > ### > > winWidth = FXListBox.new(blk1, :opts => LISTBOX_NORMAL) > [800, 1024].each { |w| winWidth.appendItem(w) } > winWindth.connect(SEL_COMMAND) do |sender, selector, data| > resize(winWidth.getItemText.to_i, height) > end > > ### > > This could save you some typing and looks (at least to me) more > readable. > > Here "height" is actually a method from FXWindow, which returns the > current height of this window's instance. The same is true for "width", > so you wouldn't need to store the window's current width in an external > variable. > More good advice. I hadn't thought to ask the Window for its size, and getItemText is much preferable to the external array. It took a few more type conversions to work, but still is much less code than my earlier solution. ### winWidth = FXListBox.new(blk1, :opts => LISTBOX_NORMAL) ["800", "1024"].each { |w| winWidth.appendItem( w ) } winWidth.connect(SEL_COMMAND) do |sender, selector, data| resize(winWidth.getItemText( data.to_i ).to_i, height) end ### Again, thanks for the suggestions! -- :D -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulst at imc.nl Mon Nov 10 05:31:56 2008 From: ulst at imc.nl (Ulrich Staudinger) Date: Mon, 10 Nov 2008 11:31:56 +0100 Subject: [fxruby-users] dnd between trees Message-ID: <49180D9C.9060902@imc.nl> Hi there, i want to drag a tree node from one tree to another in the same frame. Is this possible with FXRuby ? I can't find any documentation on that ... Also, i would like to add a popup menu to a tree node, but i can't attach the popup listener to a tree node, only to the tree. But when i do that, the tree is not expanding anylonger, propably because the events are not passed on to the underlying tree .... Is there a good tutorial on DND between trees or some other documentation ? Thanks, Ulrich -------------- next part -------------- A non-text attachment was scrubbed... Name: ulst.vcf Type: text/x-vcard Size: 219 bytes Desc: not available URL: From ulst at imc.nl Mon Nov 10 05:32:37 2008 From: ulst at imc.nl (Ulrich Staudinger) Date: Mon, 10 Nov 2008 11:32:37 +0100 Subject: [fxruby-users] Embed a Java Panel in FX Ruby ? Message-ID: <49180DC5.6080106@imc.nl> Hi there, can i somehow embed a Java JPanel into an FXRuby component ? Cheers, Ulrich -------------- next part -------------- A non-text attachment was scrubbed... Name: ulst.vcf Type: text/x-vcard Size: 219 bytes Desc: not available URL: From lyle at lylejohnson.name Mon Nov 10 08:00:45 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 10 Nov 2008 07:00:45 -0600 Subject: [fxruby-users] Embed a Java Panel in FX Ruby ? In-Reply-To: <49180DC5.6080106@imc.nl> References: <49180DC5.6080106@imc.nl> Message-ID: <0FE13FA8-B7D8-4535-8016-66428D5A5C8A@lylejohnson.name> No. On Nov 10, 2008, at 4:32 AM, Ulrich Staudinger wrote: > Hi there, > > can i somehow embed a Java JPanel into an FXRuby component ? > > Cheers, > Ulrich > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users From stuart_clarke86 at yahoo.com Mon Nov 10 17:10:57 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Mon, 10 Nov 2008 22:10:57 +0000 (GMT) Subject: [fxruby-users] Printing text in bold Message-ID: <482645.57461.qm@web86611.mail.ird.yahoo.com> Hi all, I have a FX GUI up and running on my system which displays text in a text frame. It becomes quite difficult for me to pick things out in this text within the GUI, therefore is it possible to print some of the text in say bold or a different colour? The data I am printing out is extracted from an array. Therefore do I have to do something when the data is pushed into the array? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwilde1 at gmail.com Mon Nov 10 19:06:27 2008 From: dwilde1 at gmail.com (Don Wilde) Date: Mon, 10 Nov 2008 18:06:27 -0600 Subject: [fxruby-users] Printing text in bold In-Reply-To: <482645.57461.qm@web86611.mail.ird.yahoo.com> References: <482645.57461.qm@web86611.mail.ird.yahoo.com> Message-ID: On Mon, Nov 10, 2008 at 4:10 PM, Stuart Clarke wrote: > Hi all, > > I have a FX GUI up and running on my system which displays text in a text > frame. It becomes quite difficult for me to pick things out in this text > within the GUI, therefore is it possible to print some of the text in say > bold or a different colour? The data I am printing out is extracted from an > array. Therefore do I have to do something when the data is pushed into the > array? > > Thanks in advance! > Hi, Stuart - It appears to me that a font element is associated with a whole FXRuby object. I don't believe it's possible to change font in mid-stream. There is no reason, though, why you can't build your display from a series of FXLabels (or FXTextFields with TEXTFIELD_READONLY) set to different weights of text or different sizes, one per line. It should be possible to (with appropriate :padding set and no LAYOUT_FILL) create a linear stream of text blocks, word by word, in the layout manager. The packer would stack them one after another, left to right and then down. Obviously more work than inserting BOLD, but do-able. For hardcopy printing, you can build a Postscript or RTF document and print it. HTH, let us know what you generate! -- :D -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Tue Nov 11 09:52:34 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 11 Nov 2008 08:52:34 -0600 Subject: [fxruby-users] Printing text in bold In-Reply-To: <482645.57461.qm@web86611.mail.ird.yahoo.com> References: <482645.57461.qm@web86611.mail.ird.yahoo.com> Message-ID: On Nov 10, 2008, at 4:10 PM, Stuart Clarke wrote: > I have a FX GUI up and running on my system which displays text in a > text frame. It becomes quite difficult for me to pick things out in > this text within the GUI, therefore is it possible to print some of > the text in say bold or a different colour? The data I am printing > out is extracted from an array. Therefore do I have to do something > when the data is pushed into the array? As Don noted, for most widgets (like FXLabel or FXTextField) you're stuck to just one font, in one style. If you're using the FXText widget, however, you can apply different styles to the text to get bolded text, or different colors. See the "styledtext.rb" example program that comes with FXRuby. There's also information about this in Chapter 7 of the FXRuby book. 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: From migatine at gmail.com Tue Nov 11 12:25:48 2008 From: migatine at gmail.com (=?ISO-8859-1?Q?Mich=E8le_Garoche?=) Date: Tue, 11 Nov 2008 18:25:48 +0100 Subject: [fxruby-users] FXTextField and number of digits after decimal point Message-ID: <20E8E531-19DB-4F35-BAC3-294D1EC555D3@gmail.com> Hello, Here's the context: I read a number either pure integer or float with eventually up to 12 digits after the decimal point from a YAML file. The number is injected into a FXTextField with the following code: @value_sel = FXDataTarget.new(@value.to_s) @value_value = FXTextField.new(@matrix_mem_value, 20, at value_sel, :opts =>TEXTFIELD_NORMAL|JUSTIFY_RIGHT, :selector => FXDataTarget::ID_VALUE) where @value is the number as read from the YAML file. If I use a TEXTFIELD_NORMAL, I get all the digits after the decimal point, but then it becomes difficult to test if the user entry thereafter will be correct. I I use a TEXTFIELD_INTEGER, like below, I get only three digits after the decimal point. @value_sel = FXDataTarget.new(@value) @value_value = FXTextField.new(@matrix_mem_value, 20, at value_sel, :opts =>TEXTFIELD_INTEGER|JUSTIFY_RIGHT, :selector => FXDataTarget::ID_VALUE) If I use a TEXTFIELD_REAL, I get only seven digits after the decimal point. My question is: Is there a way to use either a TEXTFIELD_INTEGER or a TEXTFIELD_REAL without losing digits after the decimal point? Note: the number I use for testing purpose is 400.12345678. Thanks in advance for any hint. Cheers, Mich?le ? Cheers, Mich?le -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 36C471DED4B09EEB30A0281F2608DB2FE6F9E147.gpgkey Type: application/octet-stream Size: 1744 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Tue Nov 11 19:58:10 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 11 Nov 2008 18:58:10 -0600 Subject: [fxruby-users] FXTextField and number of digits after decimal point In-Reply-To: <20E8E531-19DB-4F35-BAC3-294D1EC555D3@gmail.com> References: <20E8E531-19DB-4F35-BAC3-294D1EC555D3@gmail.com> Message-ID: On Nov 11, 2008, at 11:25 AM, Mich?le Garoche wrote: > My question is: Is there a way to use either a TEXTFIELD_INTEGER or > a TEXTFIELD_REAL without losing digits after the decimal point? The lack of display precision has to do with the fact that you're using an FXDataTarget to update the value of the text field. When the FXTextField sets its text from the double-precision float value that it gets from the FXDataTarget, it uses a fixed format like: sprintf(str, "%.*G", 6, value); To use a custom formatting, you'd need to stop using FXDataTarget and instead use a combination of SEL_COMMAND and SEL_UPDATE, e.g. @value_value.connect(SEL_COMMAND) do @value = @value_value.text.to_f end @value_value.connect(SEL_UPDATE) do @value_value.text = @value.to_s # or however you want to format it end Hope this helps, Lyle From wblum at pacbell.net Sat Nov 15 07:01:53 2008 From: wblum at pacbell.net (William Blum) Date: Sat, 15 Nov 2008 04:01:53 -0800 Subject: [fxruby-users] FXFont bug Message-ID: It seemed to be impossible to assign a font object to a widget's font attribute outside the initialize method. When I did so, Ruby crashed like this: E:\Ruby Programs\Demo>FontBug E:/Ruby Programs/Demo/FontBug.rb:33: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. By trial and error I think I have figured out that if you assign a font to a widget outside the parent's initialize method, you have to call create on it first. Where is the best documentation that explains under what conditions you must call create? Is it a good idea to just call create under all circumstances? The FXRuby book says in Chapter 11, "You would first construct the new FXFont object, and if necessary, call create() on it." But I can't find when "if necessary" is. FXRI does not even mention a create method for FXFont. Is this a known bug? (I consider it a bug for Ruby to seg fault no matter how wrong my code is. And my code is often very, very wrong.) From lyle at lylejohnson.name Sat Nov 15 10:42:35 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Sat, 15 Nov 2008 09:42:35 -0600 Subject: [fxruby-users] FXFont bug In-Reply-To: References: Message-ID: <1612DEA3-F5BD-4318-8FA4-56D50C7B8FD7@lylejohnson.name> On Nov 15, 2008, at 6:01 AM, William Blum wrote: > By trial and error I think I have figured out that if you assign a > font to a > widget outside the parent's initialize method, you have to call > create on it > first. > > Where is the best documentation that explains under what conditions > you must > call create? This topic is discussed in depth in section 7.7 of the FXRuby book ("Client-Side vs. Server-Side Objects"). It's also discussed in this question from the FOX FAQ: http://www.fox-toolkit.org/faq.html#ILLEGALICON > Is it a good idea to just call create under all circumstances? Not necessarily; you can't, for example, call create() on an FXFont instance until its parent FXApp has been created. But yes, assuming that has already happened, you should probably call create() on the font as soon as you construct it, e.g. font = FXFont.new(...) font.create Also, calling create() more than once on the same FXFont object is harmless; every call to create() after the first one is just a no-op. > FXRI does not even mention a create method for FXFont. I don't have FXRi installed on the computer I'm sitting at right now, but it may be the case that it doesn't show create() as a method on the FXFont class since it is actually declared in FXId, the base class for FXFont. Hope this helps, Lyle From angico at angico.org Wed Nov 19 18:21:15 2008 From: angico at angico.org (angico) Date: Wed, 19 Nov 2008 20:21:15 -0300 Subject: [fxruby-users] FXTopWindow Message-ID: <1227136875.7022.122.camel@caipora> Hi, all. I'm trying to create a "timed" dialog, i.e., a dialog that remains visible for a specified amount of time or until a user clicks any of its buttons (OK, Cancel, etc). I've tried to extend this dialog from FXDialogBox, but I just can't get out of its modal loop. So I thought of extending FXTopWindow, but it claims to be an "abstract base class" and I don't know exactly how to extend it. Can anybody, please, help me on this topic? Thanks in advance, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I Coopera??o ? muito melhor que competi??o! ------ contatos: email: angico at angico.org skype: an.gi.co ------ From jeroen at fox-toolkit.org Thu Nov 20 00:19:01 2008 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Wed, 19 Nov 2008 23:19:01 -0600 Subject: [fxruby-users] FXTopWindow In-Reply-To: <1227136875.7022.122.camel@caipora> References: <1227136875.7022.122.camel@caipora> Message-ID: <200811192319.01889.jeroen@fox-toolkit.org> On Wednesday 19 November 2008, angico wrote: > Hi, all. > > I'm trying to create a "timed" dialog, i.e., a dialog that remains > visible for a specified amount of time or until a user clicks any of its > buttons (OK, Cancel, etc). > > I've tried to extend this dialog from FXDialogBox, but I just can't get > out of its modal loop. So I thought of extending FXTopWindow, but it > claims to be an "abstract base class" and I don't know exactly how to > extend it. To get out of the modal loop, FXDialogBox calls app->stopModal(); this can be most easily accomplished via ID_CANCEL or ID_ACCEPT messages being sent to the dialogbox [they differ mainly in the return code passed along through runModalFor(). You can certainly also call accept in response to a timeout. In fact, handlers for timeout and chores have already been added to FXDialogBox: SEL_TIMEOUT, SEL_COMMAND, and SEL_CHORE with ID_CANCEL or ID_ACCEPT are available. So basically all that's needed is to set the timer to send the (SEL_TIMEOUT,ID_CANCEL) message to FXDialogBox at the desired time. Hope this helps, - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 23:10 11/19/2008 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ From angico at angico.org Thu Nov 20 04:12:57 2008 From: angico at angico.org (angico) Date: Thu, 20 Nov 2008 06:12:57 -0300 Subject: [fxruby-users] FXTopWindow In-Reply-To: <200811192319.01889.jeroen@fox-toolkit.org> References: <1227136875.7022.122.camel@caipora> <200811192319.01889.jeroen@fox-toolkit.org> Message-ID: <1227172377.7022.159.camel@caipora> Em Qua, 2008-11-19 ?s 23:19 -0600, Jeroen van der Zijp escreveu: > To get out of the modal loop, FXDialogBox calls app->stopModal(); this can > be most easily accomplished via ID_CANCEL or ID_ACCEPT messages being sent > to the dialogbox [they differ mainly in the return code passed along through > runModalFor(). > You can certainly also call accept in response to a timeout. In fact, handlers > for timeout and chores have already been added to FXDialogBox: SEL_TIMEOUT, > SEL_COMMAND, and SEL_CHORE with ID_CANCEL or ID_ACCEPT are available. > > So basically all that's needed is to set the timer to send the (SEL_TIMEOUT,ID_CANCEL) > message to FXDialogBox at the desired time. > > Hope this helps, > > > - Jeroen > > Hi, Jeroen I have already unsuccessfuly tried to exit an FXDialogBox's modal loop all the ways I could think of - and none of them worked. The basic idea for my timeout dialog box is: ----- class TimeoutDlg < FXDialogBox def execute time = 10 Thread.new(timer) super end def timer # give the user 5 seconds to respond, or accept the default while time > 0 do sleep 0.5 time -= 1 end # my first trial, based on suggestion from Lyle handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), 0) # <-- doesn't work!!! # another trial, also based on Lyle's suggestion hide app.stopModal # <-- doesn't work!!! # my last trial, based on your suggestion handle(self, FXSEL(SEL_TIMEOUT, ID_ACCEPT), 0) # <-- doesn't work!!! end ------- So, that's why I'm bound to create my own dialog, extending it from FXTopWindow, but I don't know exactly how to do it, because when I create the dialog with @dlg = TimeoutDlg, I got the error: ./timeoutdlg.rb:14:in `initialize': No matching function for overloaded 'new_FXTopWindow' (ArgumentError) from ./timeoutdlg.rb:14:in `initialize' Well, in my custom "initialize" I'm just using the same arguments to FXComposite::initialize, which, according to the documentation, is the "grandparent" of FXTopWindow. That said, I'd like to ask you two things: 1) WHY doesn't ANY of the trials to exit the FXDialogBox's modal loop work? And 2) HOW do I derive or subclass from FXTopWindow (if not for this specific use, for any other I might think of)? I'm using: ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux] FXRuby 1.6.16 I thank you very much, in advance. -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I Coopera??o ? muito melhor que competi??o! ------ contatos: email: angico at angico.org skype: an.gi.co ------ From jeroen at fox-toolkit.org Thu Nov 20 09:46:46 2008 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Thu, 20 Nov 2008 08:46:46 -0600 Subject: [fxruby-users] FXTopWindow In-Reply-To: <1227172377.7022.159.camel@caipora> References: <1227136875.7022.122.camel@caipora> <200811192319.01889.jeroen@fox-toolkit.org> <1227172377.7022.159.camel@caipora> Message-ID: <200811200846.46576.jeroen@fox-toolkit.org> On Thursday 20 November 2008, angico wrote: > Em Qua, 2008-11-19 ?s 23:19 -0600, Jeroen van der Zijp escreveu: > > > > To get out of the modal loop, FXDialogBox calls app->stopModal(); this can > > be most easily accomplished via ID_CANCEL or ID_ACCEPT messages being sent > > to the dialogbox [they differ mainly in the return code passed along through > > runModalFor(). > > You can certainly also call accept in response to a timeout. In fact, handlers > > for timeout and chores have already been added to FXDialogBox: SEL_TIMEOUT, > > SEL_COMMAND, and SEL_CHORE with ID_CANCEL or ID_ACCEPT are available. > > > > So basically all that's needed is to set the timer to send the (SEL_TIMEOUT,ID_CANCEL) > > message to FXDialogBox at the desired time. > > > > Hope this helps, > > > > > > - Jeroen > > > > > > Hi, Jeroen > > I have already unsuccessfuly tried to exit an FXDialogBox's modal loop > all the ways I could think of - and none of them worked. > > The basic idea for my timeout dialog box is: > > ----- > class TimeoutDlg < FXDialogBox > def execute > time = 10 > Thread.new(timer) > super > end > > def timer > # give the user 5 seconds to respond, or accept the default > while time > 0 do > sleep 0.5 > time -= 1 > end > > # my first trial, based on suggestion from Lyle > handle(self, FXSEL(SEL_COMMAND, ID_ACCEPT), 0) # <-- doesn't work!!! > > # another trial, also based on Lyle's suggestion > hide > app.stopModal # <-- doesn't work!!! > > # my last trial, based on your suggestion > handle(self, FXSEL(SEL_TIMEOUT, ID_ACCEPT), 0) # <-- doesn't work!!! > end > ------- > > So, that's why I'm bound to create my own dialog, extending it from > FXTopWindow, but I don't know exactly how to do it, because when I > create the dialog with @dlg = TimeoutDlg, I got the error: > > > ./timeoutdlg.rb:14:in `initialize': No matching function for overloaded > 'new_FXTopWindow' (ArgumentError) > from ./timeoutdlg.rb:14:in `initialize' > > > Well, in my custom "initialize" I'm just using the same arguments to > FXComposite::initialize, which, according to the documentation, is the > "grandparent" of FXTopWindow. > > That said, I'd like to ask you two things: 1) WHY doesn't ANY of the > trials to exit the FXDialogBox's modal loop work? And 2) HOW do I derive > or subclass from FXTopWindow (if not for this specific use, for any > other I might think of)? > > I'm using: > > ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux] > FXRuby 1.6.16 > > I thank you very much, in advance. When I said "timer" I did mean FOX timer, i.e. via app->addTimeout(). What you appear to be doing is starting another thread, which waits for a while and then invokes stopModal(). This indeed won't work, because the main GUI thread will remain blocked waiting for events from the user. Hope this helps, - Jeroen From angico at angico.org Thu Nov 20 10:25:11 2008 From: angico at angico.org (angico) Date: Thu, 20 Nov 2008 12:25:11 -0300 Subject: [fxruby-users] FXTopWindow In-Reply-To: <200811200846.46576.jeroen@fox-toolkit.org> References: <1227136875.7022.122.camel@caipora> <200811192319.01889.jeroen@fox-toolkit.org> <1227172377.7022.159.camel@caipora> <200811200846.46576.jeroen@fox-toolkit.org> Message-ID: <1227194711.7022.166.camel@caipora> Em Qui, 2008-11-20 ?s 08:46 -0600, Jeroen van der Zijp escreveu: > > When I said "timer" I did mean FOX timer, i.e. via app->addTimeout(). > > What you appear to be doing is starting another thread, which waits > for a while and then invokes stopModal(). This indeed won't work, > because the main GUI thread will remain blocked waiting for events > from the user. > > > Hope this helps, > > > - Jeroen Great!!! It works!!! Thank you very much. Despite of this very nice hint, I'd like you could give me some clues on subclassing the abstract FXTopWindow, for the case I have a specific use for it. Thanks, again, -- angico ------ home page: www.angico.org Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I Coopera??o ? muito melhor que competi??o! ------ contatos: email: angico at angico.org skype: an.gi.co ------ From aarmbruster at ndigital.com Fri Nov 21 23:34:11 2008 From: aarmbruster at ndigital.com (Armin Armbruster) Date: Fri, 21 Nov 2008 20:34:11 -0800 (PST) Subject: [fxruby-users] Dynamic generation of a (sub) layout In-Reply-To: <20630230.post@talk.nabble.com> References: <20630230.post@talk.nabble.com> Message-ID: <20633412.post@talk.nabble.com> Hi again, after digging a bit deeper I found the missing link here: http://www.nabble.com/deleting-children-and-then-adding-new-ones-to14247201.html#a14256259 The problem was that I didn't call create on the newly created buttons. I've modified my code as shown below and this seems to work. Note however that I had to add an additional variable @windowIsLive that's initialized to false at the start and gets set to true after the show command in my window-class's create function. Is there a more elegant way to handle this (for example by querying the @selectUVFrame's status)? Thanks, Armin def generateUVSelectors @selectUVFrame.each_child{|c| @selectUVFrame.removeChild(c)} b1 = FXButton.new(@selectUVFrame, "&Clear All", nil, nil, 0,) b1.connect(SEL_COMMAND){ @selectedUVs.each{|cb| cb.setCheck(false)} drawScene } b1.create if @windowIsLive b2 = FXButton.new(@selectUVFrame, "&Set All", nil, nil, 0) b2.connect(SEL_COMMAND){ @selectedUVs.each{|cb| cb.setCheck(true)} drawScene } b2.create if @windowIsLive selectMatrix = FXMatrix.new(@selectUVFrame, 4, MATRIX_BY_COLUMNS) selectMatrix.create if @windowIsLive @selectedUVs = [] uvs.length.times{|i| @selectedUVs << FXCheckButton.new(selectMatrix, i.to_s, nil, 0){ |cb| cb.setCheck(true) } @selectedUVs[-1].connect(SEL_COMMAND, method(:onSelectUV)) @selectedUVs[-1].create if @windowIsLive } @selectUVFrame.recalc end -- View this message in context: http://www.nabble.com/Dynamic-generation-of-a-%28sub%29-layout-tp20630230p20633412.html Sent from the FXRuby Users mailing list archive at Nabble.com. From aarmbruster at ndigital.com Fri Nov 21 16:59:58 2008 From: aarmbruster at ndigital.com (Armin Armbruster) Date: Fri, 21 Nov 2008 13:59:58 -0800 (PST) Subject: [fxruby-users] Dynamic generation of a (sub) layout Message-ID: <20630230.post@talk.nabble.com> Hi, first of all - I'm relatively unexpierienced with GUI programming in general and with FXRuby in particular. I've managed to write a little FXRuby app that animates some data I've collected. I made really good progress for a while, but now I'm stuck with the following problem. My data is read from file and can have a varying number of elements, depending on the file. I want to be able to turn on and off each of the elements individually by means of check-buttons. I therefore created a frame that contains a matrix of check-buttons, one for each element. This frame therefore has to be recreated every time a new file gets loaded. Below is a simplified version of what I've been trying to do. At the moment the layout works fine the first time around (currently I've hard-coded to load a specific file at startup, this will change later). However when I try to open another file, the content of @selectUVFrame disappears - nothing is displayed. I've inspected the children of @selectUVFrame and they all seem to be there, except I can't see them. If I leave out the first line ( @selectUVFrame.each_child{|c| @selectUVFrame.removeChild(c)}) the list of children of @selectUVFrame grows, but again I can't see the new ones (and the layout get's corrupted, too). I seem to miss some basic understanding here and couldn't find any hint of what I'm doing wrong. Thanks for any help, Armin @selectUVFrame is of type FXVerticalFrame and is itself a child of another frame. def generateUVSelectors @selectUVFrame.each_child{|c| @selectUVFrame.removeChild(c)} FXButton.new(@selectUVFrame, "&Clear All", nil, nil, 0,).connect(SEL_COMMAND){ @selectedUVs.each{|cb| cb.setCheck(false)} drawScene } FXButton.new(@selectUVFrame, "&Set All", nil, nil, 0).connect(SEL_COMMAND){ @selectedUVs.each{|cb| cb.setCheck(true)} drawScene } selectMatrix = FXMatrix.new(@selectUVFrame, 4, MATRIX_BY_COLUMNS) @selectedUVs = [] uvs.length.times{|i| @selectedUVs << FXCheckButton.new(selectMatrix, i.to_s, nil, 0){ |cb| cb.setCheck(true) } @selectedUVs[-1].connect(SEL_COMMAND, method(:onSelectUV)) } @selectUVFrame.recalc end -- View this message in context: http://www.nabble.com/Dynamic-generation-of-a-%28sub%29-layout-tp20630230p20630230.html Sent from the FXRuby Users mailing list archive at Nabble.com. From lyle at lylejohnson.name Mon Nov 24 09:10:36 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 24 Nov 2008 08:10:36 -0600 Subject: [fxruby-users] Dynamic generation of a (sub) layout In-Reply-To: <20633412.post@talk.nabble.com> References: <20630230.post@talk.nabble.com> <20633412.post@talk.nabble.com> Message-ID: <57cf8f720811240610nd042123of8d3f65191cc5f77@mail.gmail.com> On Fri, Nov 21, 2008 at 10:34 PM, Armin Armbruster wrote: > Is there a more elegant way to handle this (for example by querying the @selectUVFrame's status)? @selectUVFrame.created? should return true if it has already been created. Hope this helps, Lyle From lyle at lylejohnson.name Mon Nov 24 15:11:37 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 24 Nov 2008 14:11:37 -0600 Subject: [fxruby-users] Dynamic generation of a (sub) layout In-Reply-To: <32298292.234541227553944426.JavaMail.nabble@isper.nabble.com> References: <32298292.234541227553944426.JavaMail.nabble@isper.nabble.com> Message-ID: <57cf8f720811241211o567ee357n2689d46d91536218@mail.gmail.com> On Mon, Nov 24, 2008 at 1:12 PM, wrote: > I've been on ruby forum (www.ruby-forum.com) for a few years now and I actually tried to get into FXRuby a few years back... > Only recently did I find the Nabble forums which are obviously much more active, at least when it comes to FXRuby. > Why are there two forums rather than one? Armin, I don't manage any "forums" associated with FXRuby. There is an fxruby-users mailing list, information about which can be found on this page: http://www.fxruby.org/community.html The fxruby-users mailing list is the *only* one that I monitor regularly (well, that and foxgui-users). I also try to respond when someone asks an FXRuby-related question on the ruby-talk mailing list, but I don't always catch those. Web sites like nabble.com and ruby-forum.com are mirrors, of a sort, for the fxruby-users mailing list (and other mailing lists), but I don't have anything to do with those sites. If ruby-forum.com is for some reason out of sync with this mailing list, you must take that up with whoever's in charge of that web site. Hope this helps, Lyle From stuart_clarke86 at yahoo.com Tue Nov 25 15:55:22 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Tue, 25 Nov 2008 20:55:22 +0000 (GMT) Subject: [fxruby-users] Method calls with menus Message-ID: <276137.27154.qm@web86604.mail.ird.yahoo.com> Hi all, I have an FX GUI which does a number of things. It has two tabs which are two hold two different sets of data. My GUI has a menu which stipulates the contents of each tab. Clicking on the menu and open brings up a dialog box, as i the user select a folder it passed that folder (path) to a method which then scans the directory for files of certain type and prints the contents onto the GUI. I have a second GUI button which I am having trouble with. This button will only work once the first button has been selected and the data processed. This second button or RUN button is meant to pass to another method in my code which will then run searches on the already processed data. To do this I have the following code: mineEVT = FXMenuCommand.new(minerMenu, "Run...").connect(SEL_COMMAND, method(:minecompleteEVT)) My method is minecompleteEVT(). However upon running this code i get the following error: c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2 .rb:55:in `minecompleteEVT': wrong number of arguments (3 for 0) (ArgumentError) Why am I getting this error when I dont seem to passing any arguements? I take it I am not understanding something. Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Tue Nov 25 16:31:29 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 25 Nov 2008 15:31:29 -0600 Subject: [fxruby-users] Method calls with menus In-Reply-To: <276137.27154.qm@web86604.mail.ird.yahoo.com> References: <276137.27154.qm@web86604.mail.ird.yahoo.com> Message-ID: <7B06018F-28A1-463E-9DE4-E6C1A5435DB1@lylejohnson.name> On Nov 25, 2008, at 2:55 PM, Stuart Clarke wrote: > I have a second GUI button which I am having trouble with. This > button will only work once the first button has been selected and > the data processed. This second button or RUN button is meant to > pass to another method in my code which will then run searches on > the already processed data. To do this I have the following code: > > mineEVT = FXMenuCommand.new(minerMenu, > "Run...").connect(SEL_COMMAND, method(:minecompleteEVT)) > > My method is minecompleteEVT(). However upon running this code i get > the following error: > > c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/ > fox16/responder2 > .rb:55:in `minecompleteEVT': wrong number of arguments (3 for 0) > (ArgumentError) What does your minecompleteEVT() method look like? It should take three arguments: def minecompleteEVT(sender, sel, data) ... end When you click the button and FXRuby calls this method, it will pass in (1) a reference to the object (e.g. the FXButton) that's sending the message, (2) the message type and (3) any associated message data. Hope this helps, Lyle -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart_clarke86 at yahoo.com Tue Nov 25 16:31:54 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Tue, 25 Nov 2008 21:31:54 +0000 (GMT) Subject: [fxruby-users] Method calls with menus In-Reply-To: <7B06018F-28A1-463E-9DE4-E6C1A5435DB1@lylejohnson.name> Message-ID: <826496.85084.qm@web86607.mail.ird.yahoo.com> Ah yes, I should have included that, see below: ? def minecompleteEVT(sender, sel, ptr) ??? @evtrievefindings.push "Hello" ? ??? if @evtrievefindings.length != 0 ????? @mineresults.text = @evtrievefindngs.join("\n") ??? end? ? end Basically clicking the run button will run the following method, please note the above is just an example and not the contents of the actual method. Many thanks --- On Tue, 25/11/08, Lyle Johnson wrote: From: Lyle Johnson Subject: Re: [fxruby-users] Method calls with menus To: fxruby-users at rubyforge.org Date: Tuesday, 25 November, 2008, 9:31 PM On Nov 25, 2008, at 2:55 PM, Stuart Clarke wrote: I have a second GUI button which I am having trouble with. This button will only work once the first button has been selected and the data processed. This second button or RUN button is meant to pass to another method in my code which will then run searches on the already processed data. To do this I have the following code: mineEVT = FXMenuCommand.new(minerMenu, "Run...").connect(SEL_COMMAND, method(:minecompleteEVT)) My method is minecompleteEVT(). However upon running this code i get the following error: c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2 .rb:55:in `minecompleteEVT': wrong number of arguments (3 for 0) (ArgumentError) What does your minecompleteEVT() method look like? It should take three arguments: def minecompleteEVT(sender, sel, data) ... end When you click the button and FXRuby calls this method, it will pass in (1) a reference to the object (e.g. the FXButton) that's sending the message, (2) the message type and (3) any associated message data. Hope this helps, Lyle_______________________________________________ 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 lyle at lylejohnson.name Tue Nov 25 17:28:16 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 25 Nov 2008 16:28:16 -0600 Subject: [fxruby-users] Method calls with menus In-Reply-To: <826496.85084.qm@web86607.mail.ird.yahoo.com> References: <826496.85084.qm@web86607.mail.ird.yahoo.com> Message-ID: <072E1752-30EC-427C-8A4A-1ABA6D07A086@lylejohnson.name> On Nov 25, 2008, at 3:31 PM, Stuart Clarke wrote: > Ah yes, I should have included that, see below: It is unclear from your response: Are you saying that once you added those missing arguments to the method definition, it started working? Or are you saying that the argument list for minecompleteEVT() was already correct and it's still not working? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart_clarke86 at yahoo.com Wed Nov 26 04:17:07 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Wed, 26 Nov 2008 09:17:07 +0000 (GMT) Subject: [fxruby-users] Method calls with menus In-Reply-To: <072E1752-30EC-427C-8A4A-1ABA6D07A086@lylejohnson.name> Message-ID: <718736.94355.qm@web86607.mail.ird.yahoo.com> Sorry. ? I already had that code in my method and I still get the same error which to me doesn't make any sense. My method that gives the error looks like: ? ? def minecompleteEVT(sender, sel, ptr) ??? @evtrievefindings.push "Hello" ? ??? if @evtrievefindings.length != 0 ????? @mineresults.text = @evtrievefindngs.join("\n") ??? end? ? end ? Many thanks. If you need more of my code, I can get it to you. --- On Tue, 25/11/08, Lyle Johnson wrote: From: Lyle Johnson Subject: Re: [fxruby-users] Method calls with menus To: fxruby-users at rubyforge.org Date: Tuesday, 25 November, 2008, 10:28 PM On Nov 25, 2008, at 3:31 PM, Stuart Clarke wrote: Ah yes, I should have included that, see below: It is unclear from your response: Are you saying that once you added those missing arguments to the method definition, it started working? Or are you saying that the argument list for minecompleteEVT() was already correct and it's still not working?_______________________________________________ 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 stuart_clarke86 at yahoo.com Wed Nov 26 16:44:39 2008 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Wed, 26 Nov 2008 21:44:39 +0000 (GMT) Subject: [fxruby-users] Method calls with menus In-Reply-To: <072E1752-30EC-427C-8A4A-1ABA6D07A086@lylejohnson.name> Message-ID: <793203.51068.qm@web86608.mail.ird.yahoo.com> I have fixed that problem now, it was not liking being public to the entire class. However I am getting an error like so which is new and I have not changed any of my code. I have simpily broke it down into 2 steps: ?syntax error, unexpected tCONSTANT, expecting ')' More strange is the data that is causing this error is commented out see below: #@evtrievefindings.push "Number of sucessful local logons: #{locallogon}" Thanks --- On Tue, 25/11/08, Lyle Johnson wrote: From: Lyle Johnson Subject: Re: [fxruby-users] Method calls with menus To: fxruby-users at rubyforge.org Date: Tuesday, 25 November, 2008, 10:28 PM On Nov 25, 2008, at 3:31 PM, Stuart Clarke wrote: Ah yes, I should have included that, see below: It is unclear from your response: Are you saying that once you added those missing arguments to the method definition, it started working? Or are you saying that the argument list for minecompleteEVT() was already correct and it's still not working?_______________________________________________ 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 lyle at lylejohnson.name Wed Nov 26 19:58:24 2008 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 26 Nov 2008 18:58:24 -0600 Subject: [fxruby-users] Method calls with menus In-Reply-To: <793203.51068.qm@web86608.mail.ird.yahoo.com> References: <793203.51068.qm@web86608.mail.ird.yahoo.com> Message-ID: <8B3842FB-2A96-4450-97EC-B9882A0DD062@lylejohnson.name> On Nov 26, 2008, at 3:44 PM, Stuart Clarke wrote: > I have fixed that problem now, it was not liking being public to the > entire class. However I am getting an error like so which is new and > I have not changed any of my code. I have simpily broke it down into > 2 steps: > > syntax error, unexpected tCONSTANT, expecting ')' > > More strange is the data that is causing this error is commented out > see below: > > #@evtrievefindings.push "Number of sucessful local logons: > #{locallogon}" Is there any way you can post the revised code (or send it off-list if you'd prefer)? It looks like you have a syntax error somewhere in this *.rb file, probably somewhere *before* the line that it's actually reporting as having the error. When I get a syntax error like this and I just can't see where it is, I find it sometimes helps to comment out sections of the code until it starts working, and then focus in on the most recently commented out section (which is likely to be where the problem lies). -------------- next part -------------- An HTML attachment was scrubbed... URL: