From stuart_clarke86 at yahoo.com Mon Mar 1 06:09:54 2010 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Mon, 1 Mar 2010 11:09:54 +0000 (GMT) Subject: [fxruby-users] Class with looping objects In-Reply-To: <639320.47948.qm@web86602.mail.ird.yahoo.com> Message-ID: <958835.56514.qm@web86603.mail.ird.yahoo.com> Hi, I have a GUI which triggers an object to do some stuff, when you press the FXButton it calls matcher e.g. button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) This button remains in a pressed state until the object has finished running, when it is complete the button pops back up. I am trying to add a popup box to respond to the button popping up (or processing finished) like so: if button == SEL_KEYRELEASE??FXMessageBox.information(self, MBOX_OK, "Complete")??mainwindow.closeend This however does not work, any ideas how I can acheive this? Many thanks --- On Fri, 26/2/10, Stuart Clarke wrote: From: Stuart Clarke Subject: [fxruby-users] Class with looping objects To: fxruby-users at rubyforge.org Date: Friday, 26 February, 2010, 19:38 Hi all, Apologies if this is a stupid question but it is getting the best of me. I have a class which contains a GUI object which has serveral text fields and buttons which when used trigger the use of further objects which all loop through data, the structure is as follows: class def GUI GUI calls object1 end def object1 loops through some data one entry at a time and for each entry passes to a new object end def object2 loops through passed data and does stuff end then the next bit of data does the same thing in object1 What I need is a gui that pops up when my script runs through all of objects for each bit of data. Any ideas? I just need to know when the loop is complete, at present I press the go button on my fx GUI and it stays pressed in until all processing is done then pops back out. At this point I need a Gui. I hope this makes sense, Many thanks ? ? ? _______________________________________________ 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 matma.rex at gmail.com Mon Mar 1 08:58:58 2010 From: matma.rex at gmail.com (=?UTF-8?Q?Bartosz_Dziewo=C5=84ski?=) Date: Mon, 1 Mar 2010 14:58:58 +0100 Subject: [fxruby-users] Class with looping objects In-Reply-To: <958835.56514.qm@web86603.mail.ird.yahoo.com> References: <639320.47948.qm@web86602.mail.ird.yahoo.com> <958835.56514.qm@web86603.mail.ird.yahoo.com> Message-ID: You should probably just show us the code that doesnt work, so we can just fix it instead of guessing what might be wrong. -- Matma Rex - http://matma-rex.prv.pl/ From jkinsella at ancillaryservices.com Mon Mar 1 09:43:00 2010 From: jkinsella at ancillaryservices.com (Joey Kinsella) Date: Mon, 1 Mar 2010 09:43:00 -0500 Subject: [fxruby-users] Class with looping objects In-Reply-To: <958835.56514.qm@web86603.mail.ird.yahoo.com> References: <639320.47948.qm@web86602.mail.ird.yahoo.com> <958835.56514.qm@web86603.mail.ird.yahoo.com> Message-ID: <39b4b9791003010643l7c5cb643mf0efea8d80ccb035@mail.gmail.com> Couldn't you just do: def initialize # ... button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) # ... end def matcher(sender, selector, data) # ... self.close # (true) # if you want to notify the messaging system. end or well, something along those lines.. button is a reference to an FXButton object, It should never equal SEL_KEYRELEASE in this respect. Also the code above is assuming that it's an object which extends FXMainWindow. Hope this helps, -Joey On Mon, Mar 1, 2010 at 6:09 AM, Stuart Clarke wrote: > Hi, > > I have a GUI which triggers an object to do some stuff, when you press the > FXButton it calls matcher e.g. > > button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) > > This button remains in a pressed state until the object has finished > running, when it is complete the button pops back up. I am trying to add a > popup box to respond to the button popping up (or processing finished) like > so: > > if button == SEL_KEYRELEASE > FXMessageBox.information(self, MBOX_OK, "Complete") > mainwindow.close > end > > This however does not work, any ideas how I can acheive this? > > Many thanks > > --- On *Fri, 26/2/10, Stuart Clarke * wrote: > > > From: Stuart Clarke > Subject: [fxruby-users] Class with looping objects > To: fxruby-users at rubyforge.org > Date: Friday, 26 February, 2010, 19:38 > > > Hi all, > > Apologies if this is a stupid question but it is getting the best of me. > > I have a class which contains a GUI object which has serveral text fields > and buttons which when used trigger the use of further objects which all > loop through data, the structure is as follows: > > class > def GUI > GUI calls object1 > end > def object1 loops through some data one entry at a time and for each entry > passes to a new object > end > def object2 loops through passed data and does stuff > end > then the next bit of data does the same thing in object1 > > > What I need is a gui that pops up when my script runs through all of > objects for each bit of data. Any ideas? I just need to know when the loop > is complete, at present I press the go button on my fx GUI and it stays > pressed in until all processing is done then pops back out. At this point I > need a Gui. > > I hope this makes sense, > > Many thanks > > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart_clarke86 at yahoo.com Tue Mar 2 04:34:09 2010 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Tue, 2 Mar 2010 09:34:09 +0000 (GMT) Subject: [fxruby-users] Class with looping objects In-Reply-To: <39b4b9791003010643l7c5cb643mf0efea8d80ccb035@mail.gmail.com> Message-ID: <2763.42533.qm@web86602.mail.ird.yahoo.com> Hi, Thanks for your reply. I have tried this previously and I get the following error: C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/aliases.rb:4812:in `getText': This FXTextField * already released (RuntimeError) Code is: ??buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher))?enddef matcher(sender, sel, ptr)?? self.close(true)#.... Just to clarify, when matcher runs, it does Matcher object - get first item and call object2Object2 does stuff and then we go back to object matcher and get the next itemThis loop?continues?until all items have been through both objects then once finished the run button pops up again and the processing is done, at this point I want a GUI. Thanks a lot Stuart --- On Mon, 1/3/10, Joey Kinsella wrote: From: Joey Kinsella Subject: Re: [fxruby-users] Class with looping objects To: fxruby-users at rubyforge.org Date: Monday, 1 March, 2010, 14:43 Couldn't you just do: def initialize ? # ... ? button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) ? # ... end def matcher(sender, selector, data) ? # ... ? self.close # (true) # if you want to notify the messaging system. end or well, something along those lines.. button is a reference to an FXButton object, It should never equal SEL_KEYRELEASE in this respect. Also the code above is assuming that it's an object which extends FXMainWindow. Hope this helps, -Joey On Mon, Mar 1, 2010 at 6:09 AM, Stuart Clarke wrote: Hi, I have a GUI which triggers an object to do some stuff, when you press the FXButton it calls matcher e.g. button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) This button remains in a pressed state until the object has finished running, when it is complete the button pops back up. I am trying to add a popup box to respond to the button popping up (or processing finished) like so: if button == SEL_KEYRELEASE??FXMessageBox.information(self, MBOX_OK, "Complete")??mainwindow.closeend This however does not work, any ideas how I can acheive this? Many thanks --- On Fri, 26/2/10, Stuart Clarke wrote: From: Stuart Clarke Subject: [fxruby-users] Class with looping objects To: fxruby-users at rubyforge.org Date: Friday, 26 February, 2010, 19:38 Hi all, Apologies if this is a stupid question but it is getting the best of me. I have a class which contains a GUI object which has serveral text fields and buttons which when used trigger the use of further objects which all loop through data, the structure is as follows: class def GUI GUI calls object1 end def object1 loops through some data one entry at a time and for each entry passes to a new object end def object2 loops through passed data and does stuff end then the next bit of data does the same thing in object1 What I need is a gui that pops up when my script runs through all of objects for each bit of data. Any ideas? I just need to know when the loop is complete, at present I press the go button on my fx GUI and it stays pressed in until all processing is done then pops back out. At this point I need a Gui. I hope this makes sense, Many thanks ? ? ? _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -----Inline Attachment Follows----- _______________________________________________ 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 jkinsella at ancillaryservices.com Tue Mar 2 08:58:27 2010 From: jkinsella at ancillaryservices.com (Joey Kinsella) Date: Tue, 2 Mar 2010 08:58:27 -0500 Subject: [fxruby-users] Class with looping objects In-Reply-To: <2763.42533.qm@web86602.mail.ird.yahoo.com> References: <39b4b9791003010643l7c5cb643mf0efea8d80ccb035@mail.gmail.com> <2763.42533.qm@web86602.mail.ird.yahoo.com> Message-ID: <39b4b9791003020558r2d0cfce8k131223f101d26edd@mail.gmail.com> It would be much easier to help you if we could see at least example code (similar to what your doing.) However, the error you displayed below tells me your doing something incorrectly. Are you sure self.close() is really what you want to do? Perhaps you should try self.hide()/self.show(). I don't know, without actual code it's hard to tell what you are trying to do. But I hope this helps. On Tue, Mar 2, 2010 at 4:34 AM, Stuart Clarke wrote: > Hi, > > Thanks for your reply. > > I have tried this previously and I get the following error: > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/aliases.rb:4812:in > `getText': This FXTextField * already released (RuntimeError) > > Code is: > > buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, > method(:matcher)) > end > def matcher(sender, sel, ptr) > self.close(true) > #.... > > Just to clarify, when matcher runs, it does > > Matcher object - get first item and call object2 > Object2 does stuff and then we go back to object matcher and get the next > item > This loop continues until all items have been through both objects then > once finished the run button pops up again and the processing is done, at > this point I want a GUI. > > Thanks a lot > > Stuart > > > --- On *Mon, 1/3/10, Joey Kinsella *wrote: > > > From: Joey Kinsella > Subject: Re: [fxruby-users] Class with looping objects > > To: fxruby-users at rubyforge.org > Date: Monday, 1 March, 2010, 14:43 > > Couldn't you just do: > > def initialize > # ... > button = FXButton.new(frame, "Run").connect(SEL_COMMAND, > method(:matcher)) > # ... > end > > def matcher(sender, selector, data) > # ... > self.close # (true) # if you want to notify the messaging system. > end > > or well, something along those lines.. button is a reference to an FXButton > object, It should never equal SEL_KEYRELEASE in this respect. Also the code > above is assuming that it's an object which extends FXMainWindow. > > Hope this helps, > -Joey > > On Mon, Mar 1, 2010 at 6:09 AM, Stuart Clarke > > wrote: > >> Hi, >> >> I have a GUI which triggers an object to do some stuff, when you press the >> FXButton it calls matcher e.g. >> >> button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) >> >> This button remains in a pressed state until the object has finished >> running, when it is complete the button pops back up. I am trying to add a >> popup box to respond to the button popping up (or processing finished) like >> so: >> >> if button == SEL_KEYRELEASE >> FXMessageBox.information(self, MBOX_OK, "Complete") >> mainwindow.close >> end >> >> This however does not work, any ideas how I can acheive this? >> >> Many thanks >> >> --- On *Fri, 26/2/10, Stuart Clarke >> >* wrote: >> >> >> From: Stuart Clarke >> > >> Subject: [fxruby-users] Class with looping objects >> To: fxruby-users at rubyforge.org >> Date: Friday, 26 February, 2010, 19:38 >> >> >> Hi all, >> >> Apologies if this is a stupid question but it is getting the best of me. >> >> I have a class which contains a GUI object which has serveral text fields >> and buttons which when used trigger the use of further objects which all >> loop through data, the structure is as follows: >> >> class >> def GUI >> GUI calls object1 >> end >> def object1 loops through some data one entry at a time and for each entry >> passes to a new object >> end >> def object2 loops through passed data and does stuff >> end >> then the next bit of data does the same thing in object1 >> >> >> What I need is a gui that pops up when my script runs through all of >> objects for each bit of data. Any ideas? I just need to know when the loop >> is complete, at present I press the go button on my fx GUI and it stays >> pressed in until all processing is done then pops back out. At this point I >> need a Gui. >> >> I hope this makes sense, >> >> Many thanks >> >> >> >> _______________________________________________ >> fxruby-users mailing list >> fxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/fxruby-users >> >> >> >> _______________________________________________ >> fxruby-users mailing list >> fxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/fxruby-users >> > > -- > If you are not the intended recipient, you are hereby notified > that any dissemination, distribution, copying or other use of > this communication is strictly prohibited. If you have > received this communication in error, please notify us > immediately. > > > > -----Inline Attachment Follows----- > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alex.Decaria at millersville.edu Tue Mar 2 07:49:46 2010 From: Alex.Decaria at millersville.edu (Alex DeCaria) Date: Tue, 2 Mar 2010 07:49:46 -0500 Subject: [fxruby-users] FXRuby and 64-Bit Windows OS Message-ID: This is a follow up to my Feb 18 post on the Ruby forum: Are others experiencing problems using FXRuby on 64-bit Windows platforms? I have an FXRuby app that works fine on 32-bit Windows XP, but has random segmentation faults and other errors on a 64-bit Windows 7 platform. I've attached a screen shot of the typical errors that I get. The application will run for a time, but eventually will crash with a segmentation fault. Also, there are numerous FXCursor.cpp errors that appear as the application is starting (but the application still starts and runs despite these initial errors). Again, this only happens on the 64-bit system. The same app works with no errors on a 32-bit Windows OS. Lyle had responded to my earlier post indicating that it seems to be an issue with the FOX Library itself, not the FXRuby wrapper. I see on the FOX Library webpage that over the past year or two they've addressed some 64 vs 32 bit issues. Does FXRuby use the latest version of the FOX library? If not, will the newer version of the FOX Library solve these issues? Are there any workarounds? --Alex DeCaria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Error.jpg Type: image/pjpeg Size: 296421 bytes Desc: Error.jpg URL: From lyle at lylejohnson.name Tue Mar 2 14:43:38 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 2 Mar 2010 13:43:38 -0600 Subject: [fxruby-users] FXRuby and 64-Bit Windows OS In-Reply-To: References: Message-ID: <57cf8f721003021143o5e24300cu2d8386f26b3d1d99@mail.gmail.com> On Tue, Mar 2, 2010 at 6:49 AM, Alex DeCaria wrote: > Lyle had responded to my earlier post indicating that it seems to be an > issue with the FOX Library itself, not the FXRuby wrapper.? I see on the FOX > Library webpage that over the past year or two they've addressed some 64 vs > 32 bit issues.? Does FXRuby use the latest version of the FOX library? The binary gem for FXRuby version 1.6.20 on Windows is built with FOX 1.6.36, which is close to the latest release (version 1.6.37). I don't see anything in the release notes for 1.6.37 that sound like they would address this problem, though. > Are there any workarounds? That's hard to say without really knowing what's going on. It's usually helpful in cases like this to post some code that reproduces the problem, so that anyone who's interested can at least attempt to diagnose the problem. If I can reproduce it on my Mac OS X notebook, I might be able to come up with a fix, but I don't even have access to a 64-bit Windows environment for testing your particular configuration. From stuart_clarke86 at yahoo.com Tue Mar 2 15:22:02 2010 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Tue, 2 Mar 2010 20:22:02 +0000 (GMT) Subject: [fxruby-users] Class with looping objects In-Reply-To: <39b4b9791003020558r2d0cfce8k131223f101d26edd@mail.gmail.com> Message-ID: <297357.36799.qm@web86601.mail.ird.yahoo.com> Hey, Thanks for the reply, I do not have the code to hand, I will pick it up tomorrow and send it on, however in the meantime a summary is shown below (please note syntax is not 100%): class Searcher < FXMainWindowdef initializecreate a windowcreate a framecreate some text boxes - give a folder pathcreate the button which calls object matcherenddef matcherusing find run through directory and find first filecall next object fileProcessing with the first fileenddef?fileProcessingIO.FOREACH on filerun some if statements on the fileendend So after def?fileProcessing finishes it goes back to matcher and gets the next file. I hope this helps, but I will post actual code tomorrow. Thanks Many thanks Stuart --- On Tue, 2/3/10, Joey Kinsella wrote: From: Joey Kinsella Subject: Re: [fxruby-users] Class with looping objects To: fxruby-users at rubyforge.org Date: Tuesday, 2 March, 2010, 13:58 It would be much easier to help you if we could see at least example code (similar to what your doing.) However, the error you displayed below tells me your doing something incorrectly. Are you sure self.close() is really what you want to do? Perhaps you should try self.hide()/self.show(). I don't know, without actual code it's hard to tell what you are trying to do. But I hope this helps. On Tue, Mar 2, 2010 at 4:34 AM, Stuart Clarke wrote: Hi, Thanks for your reply. I have tried this previously and I get the following error: C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/aliases.rb:4812:in `getText': This FXTextField * already released (RuntimeError) Code is: ??buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher))?enddef matcher(sender, sel, ptr)?? self.close(true) #.... Just to clarify, when matcher runs, it does Matcher object - get first item and call object2Object2 does stuff and then we go back to object matcher and get the next item This loop?continues?until all items have been through both objects then once finished the run button pops up again and the processing is done, at this point I want a GUI. Thanks a lot Stuart --- On Mon, 1/3/10, Joey Kinsella wrote: From: Joey Kinsella Subject: Re: [fxruby-users] Class with looping objects To: fxruby-users at rubyforge.org Date: Monday, 1 March, 2010, 14:43 Couldn't you just do: def initialize ? # ... ? button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) ? # ... end def matcher(sender, selector, data) ? # ... ? self.close # (true) # if you want to notify the messaging system. end or well, something along those lines.. button is a reference to an FXButton object, It should never equal SEL_KEYRELEASE in this respect. Also the code above is assuming that it's an object which extends FXMainWindow. Hope this helps, -Joey On Mon, Mar 1, 2010 at 6:09 AM, Stuart Clarke wrote: Hi, I have a GUI which triggers an object to do some stuff, when you press the FXButton it calls matcher e.g. button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) This button remains in a pressed state until the object has finished running, when it is complete the button pops back up. I am trying to add a popup box to respond to the button popping up (or processing finished) like so: if button == SEL_KEYRELEASE??FXMessageBox.information(self, MBOX_OK, "Complete")??mainwindow.closeend This however does not work, any ideas how I can acheive this? Many thanks --- On Fri, 26/2/10, Stuart Clarke wrote: From: Stuart Clarke Subject: [fxruby-users] Class with looping objects To: fxruby-users at rubyforge.org Date: Friday, 26 February, 2010, 19:38 Hi all, Apologies if this is a stupid question but it is getting the best of me. I have a class which contains a GUI object which has serveral text fields and buttons which when used trigger the use of further objects which all loop through data, the structure is as follows: class def GUI GUI calls object1 end def object1 loops through some data one entry at a time and for each entry passes to a new object end def object2 loops through passed data and does stuff end then the next bit of data does the same thing in object1 What I need is a gui that pops up when my script runs through all of objects for each bit of data. Any ideas? I just need to know when the loop is complete, at present I press the go button on my fx GUI and it stays pressed in until all processing is done then pops back out. At this point I need a Gui. I hope this makes sense, Many thanks ? ? ? _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -----Inline Attachment Follows----- _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -----Inline Attachment Follows----- _______________________________________________ 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 Alex.Decaria at millersville.edu Tue Mar 2 15:30:00 2010 From: Alex.Decaria at millersville.edu (Alex DeCaria) Date: Tue, 2 Mar 2010 15:30:00 -0500 Subject: [fxruby-users] FXRuby and 64-Bit Windows OS In-Reply-To: <57cf8f721003021143o5e24300cu2d8386f26b3d1d99@mail.gmail.com> References: <57cf8f721003021143o5e24300cu2d8386f26b3d1d99@mail.gmail.com> Message-ID: I have to amend my earlier statement. The program just exhibited the same behavior on my 32-bit Windows OS, so it's obviously not an OS issue, and likely due to my own faulty programming skills. This is my first attempt at an FXRuby application (I'm converting from TK) and I'm not doing something correctly. The application runs just fine for a while, but after enough use (clicking on various list boxes) eventually gives the segmentation error. I've attached it in case anyone is bored enough and has the time/inclination to look at it and can give me some pointers as to how to clean it up and use a better programming idiom. The code is ugly, I know, because it is my first try. Sorry for my original mistake of thinking it was the OS. --Alex -----Original Message----- From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Lyle Johnson Sent: Tuesday, March 02, 2010 2:44 PM To: fxruby-users at rubyforge.org Subject: Re: [fxruby-users] FXRuby and 64-Bit Windows OS On Tue, Mar 2, 2010 at 6:49 AM, Alex DeCaria wrote: > Lyle had responded to my earlier post indicating that it seems to be an > issue with the FOX Library itself, not the FXRuby wrapper.? I see on the FOX > Library webpage that over the past year or two they've addressed some 64 vs > 32 bit issues.? Does FXRuby use the latest version of the FOX library? The binary gem for FXRuby version 1.6.20 on Windows is built with FOX 1.6.36, which is close to the latest release (version 1.6.37). I don't see anything in the release notes for 1.6.37 that sound like they would address this problem, though. > Are there any workarounds? That's hard to say without really knowing what's going on. It's usually helpful in cases like this to post some code that reproduces the problem, so that anyone who's interested can at least attempt to diagnose the problem. If I can reproduce it on my Mac OS X notebook, I might be able to come up with a fix, but I don't even have access to a 64-bit Windows environment for testing your particular configuration. _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- A non-text attachment was scrubbed... Name: unit_converter_FX.rb Type: application/octet-stream Size: 12224 bytes Desc: unit_converter_FX.rb URL: From stuart_clarke86 at yahoo.com Wed Mar 3 07:11:00 2010 From: stuart_clarke86 at yahoo.com (Stuart Clarke) Date: Wed, 3 Mar 2010 12:11:00 +0000 (GMT) Subject: [fxruby-users] Class with looping objects In-Reply-To: <39b4b9791003020558r2d0cfce8k131223f101d26edd@mail.gmail.com> Message-ID: <342736.33459.qm@web86606.mail.ird.yahoo.com> See code below, many thanks: require 'fox16'include Fox require "find"require "fileutils" class ScriptGui < FXMainWindow #SUBCLASS FOR CREATING A WINDOW, CONTAINS ALL THE CUSTOMISATION INFORMATION??def initialize(app)?? ?super(app, "Script", :width => 700, :height => 200)?? ?frame = FXVerticalFrame.new(self, LAYOUT_LEFT|LAYOUT_FILL_X)?? ?#FRAMES FOR INPUT?? ?frame1 = FXHorizontalFrame.new(frame, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) ?? ??? ?inputFileA = FXButton.new(frame1, "Input File")?? ?inputFileA.connect(SEL_COMMAND) do ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #the connect will ensure the following block is performed?? ? ?dialog = FXFileDialog.new(self, "Select file")?? ? ?dialog.patternList = ["Text Files (*.txt)", "All Files (*)"] ? ? ? ?#recognised file types?? ? ?dialog.selectMode = SELECTFILE_EXISTING ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?#select a file?? ? ?if dialog.execute != 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #display the box and wait fot user response?? ? ? ?@aInput.text = dialog.filename ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #if the user selects a file it write it in inputfield?? ? ?end?? ?end?? ?@aInput = FXTextField.new(frame1, 90, :opts => JUSTIFY_LEFT|FRAME_SUNKEN|FRAME_THICK)?? ??? ?FXHorizontalSeparator.new(frame, :opts => LAYOUT_FILL_X|SEPARATOR_GROOVE)?? ??? ?buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) ? ? ? ? ? ? ? ? ? ? ? ? #call method matcher to commence process??end????def matcher(sender, sel, ptr)?? ?#set up hash for itemC and doc ID?? ?@hashMapping = Hash.new {|h,k| h[k] = []}?? ??? ?#process loadfile to capture doc ID's & itemC values.?? ?IO.foreach(@aInput.to_s) do |data| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #go through the input concordance loadfile?? ? ?fields = data.split("") ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #split the field on this??? ? ?itemA = ?fields[13].delete("?").downcase ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ?itemB = fields[0].delete("?,\"") ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ???? ? ?itemC = fields[35].delete("?,\"") ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ???? ? ?if itemA.to_s.downcase == "pdf" ? ? ? ? ? ? ? ? ? ??? ? ? ?@hashMapping[itemC] << itemB ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?end?? ?end?? ??? ?Find.find(@aInput.to_s) do |curPath2| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ???? ? ?if File.file?(curPath2) and curPath2[/\.txt$/]??? ? ? ?itemCFN = File.basename(curPath2, ".txt").strip.to_s.downcase ? ? ? ? ?#grabs the file name stripping whitespace?? ? ? ?finditemC(curPath2, itemCFN) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ?end?? ?end??end????def finditemC(curPath2, itemCFN) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ?@hashMapping.each do |itemDetail|?? ? ?@entryArray = [] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ?entry = itemDetail.to_s.strip ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ?@entryArray << itemDetail.to_s.strip ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ?if entry.match(/#{itemCFN}/) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ? ?puts itemCFN?? ? ?end?? ?end??end ??def create?? ?super?? ? ?show(PLACEMENT_SCREEN) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? #SHOW THE GUI ON THE SCREEN?? ?end??end #CONSTRUCTORif __FILE__ == $0??FXApp.new do |app|?? ?ScriptGui.new(app)?? ?app.create#CALLS THE METHOD CREATE TO ENSURE ALL NEEDED INFO IS ADDED?? ?app.run#STARTS THE CREATION OF THE WINDOWS??endend --- On Tue, 2/3/10, Joey Kinsella wrote: From: Joey Kinsella Subject: Re: [fxruby-users] Class with looping objects To: fxruby-users at rubyforge.org Date: Tuesday, 2 March, 2010, 13:58 It would be much easier to help you if we could see at least example code (similar to what your doing.) However, the error you displayed below tells me your doing something incorrectly. Are you sure self.close() is really what you want to do? Perhaps you should try self.hide()/self.show(). I don't know, without actual code it's hard to tell what you are trying to do. But I hope this helps. On Tue, Mar 2, 2010 at 4:34 AM, Stuart Clarke wrote: Hi, Thanks for your reply. I have tried this previously and I get the following error: C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/aliases.rb:4812:in `getText': This FXTextField * already released (RuntimeError) Code is: ??buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher))?enddef matcher(sender, sel, ptr)?? self.close(true) #.... Just to clarify, when matcher runs, it does Matcher object - get first item and call object2Object2 does stuff and then we go back to object matcher and get the next item This loop?continues?until all items have been through both objects then once finished the run button pops up again and the processing is done, at this point I want a GUI. Thanks a lot Stuart --- On Mon, 1/3/10, Joey Kinsella wrote: From: Joey Kinsella Subject: Re: [fxruby-users] Class with looping objects To: fxruby-users at rubyforge.org Date: Monday, 1 March, 2010, 14:43 Couldn't you just do: def initialize ? # ... ? button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) ? # ... end def matcher(sender, selector, data) ? # ... ? self.close # (true) # if you want to notify the messaging system. end or well, something along those lines.. button is a reference to an FXButton object, It should never equal SEL_KEYRELEASE in this respect. Also the code above is assuming that it's an object which extends FXMainWindow. Hope this helps, -Joey On Mon, Mar 1, 2010 at 6:09 AM, Stuart Clarke wrote: Hi, I have a GUI which triggers an object to do some stuff, when you press the FXButton it calls matcher e.g. button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) This button remains in a pressed state until the object has finished running, when it is complete the button pops back up. I am trying to add a popup box to respond to the button popping up (or processing finished) like so: if button == SEL_KEYRELEASE??FXMessageBox.information(self, MBOX_OK, "Complete")??mainwindow.closeend This however does not work, any ideas how I can acheive this? Many thanks --- On Fri, 26/2/10, Stuart Clarke wrote: From: Stuart Clarke Subject: [fxruby-users] Class with looping objects To: fxruby-users at rubyforge.org Date: Friday, 26 February, 2010, 19:38 Hi all, Apologies if this is a stupid question but it is getting the best of me. I have a class which contains a GUI object which has serveral text fields and buttons which when used trigger the use of further objects which all loop through data, the structure is as follows: class def GUI GUI calls object1 end def object1 loops through some data one entry at a time and for each entry passes to a new object end def object2 loops through passed data and does stuff end then the next bit of data does the same thing in object1 What I need is a gui that pops up when my script runs through all of objects for each bit of data. Any ideas? I just need to know when the loop is complete, at present I press the go button on my fx GUI and it stays pressed in until all processing is done then pops back out. At this point I need a Gui. I hope this makes sense, Many thanks ? ? ? _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -----Inline Attachment Follows----- _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -----Inline Attachment Follows----- _______________________________________________ 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 kb9agt at gmail.com Wed Mar 3 18:01:31 2010 From: kb9agt at gmail.com (Douglas Allen) Date: Wed, 3 Mar 2010 17:01:31 -0600 Subject: [fxruby-users] Class with looping objects In-Reply-To: <2763.42533.qm@web86602.mail.ird.yahoo.com> References: <39b4b9791003010643l7c5cb643mf0efea8d80ccb035@mail.gmail.com> <2763.42533.qm@web86602.mail.ird.yahoo.com> Message-ID: Most FOX objects send out messages (also known as *events*) when something interesting happens. FOX messages have four important elements: 1. The message *sender* is the object that sends the message. In this case, the FXButton instance is the sender. 2. The message *type* is a predefined integer constant that indicates what kind of event has occurred (i.e. why this message is being sent). In this case, the message type is SEL_COMMAND, which indicates that the command associated with this widget should be invoked. 3. The message *identifier* is another integer constant that is used to distinguish between different messages of the same type. For example, the message that tells a FOX window to make itself visible is a SEL_COMMANDmessage with the identifier FXWindow::ID_SHOW (where ID_SHOW is a constant defined in the FXWindowclass). A different message identifier, FXWindow::ID_HIDE, tells an FXWindow instance to make itself invisible. 4. The message *data* is an object containing message-specific information. For this case (the FXButton's SEL_COMMAND message, there is no interesting message data, but we'll see other kinds of messages where the message data is useful. On 3/2/10, Stuart Clarke wrote: > > Hi, > > Thanks for your reply. > > I have tried this previously and I get the following error: > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/aliases.rb:4812:in > `getText': This FXTextField * already released (RuntimeError) > > Code is: > > buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, > method(:matcher)) > end > def matcher(sender, sel, ptr) > self.close(true) > #.... > > Just to clarify, when matcher runs, it does > > Matcher object - get first item and call object2 > Object2 does stuff and then we go back to object matcher and get the next > item > This loop continues until all items have been through both objects then > once finished the run button pops up again and the processing is done, at > this point I want a GUI. > > Thanks a lot > > Stuart > > > --- On *Mon, 1/3/10, Joey Kinsella *wrote: > > > From: Joey Kinsella > Subject: Re: [fxruby-users] Class with looping objects > To: fxruby-users at rubyforge.org > Date: Monday, 1 March, 2010, 14:43 > > > Couldn't you just do: > > def initialize > # ... > button = FXButton.new(frame, "Run").connect(SEL_COMMAND, > method(:matcher)) > # ... > end > > def matcher(sender, selector, data) > # ... > self.close # (true) # if you want to notify the messaging system. > end > > or well, something along those lines.. button is a reference to an FXButton > object, It should never equal SEL_KEYRELEASE in this respect. Also the code > above is assuming that it's an object which extends FXMainWindow. > > Hope this helps, > -Joey > > On Mon, Mar 1, 2010 at 6:09 AM, Stuart Clarke > > wrote: > >> Hi, >> >> I have a GUI which triggers an object to do some stuff, when you press the >> FXButton it calls matcher e.g. >> >> button = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) >> >> This button remains in a pressed state until the object has finished >> running, when it is complete the button pops back up. I am trying to add a >> popup box to respond to the button popping up (or processing finished) like >> so: >> >> if button == SEL_KEYRELEASE >> FXMessageBox.information(self, MBOX_OK, "Complete") >> mainwindow.close >> end >> >> This however does not work, any ideas how I can acheive this? >> >> Many thanks >> >> --- On *Fri, 26/2/10, Stuart Clarke >> >* wrote: >> >> >> From: Stuart Clarke >> > >> Subject: [fxruby-users] Class with looping objects >> To: fxruby-users at rubyforge.org >> Date: Friday, 26 February, 2010, 19:38 >> >> >> Hi all, >> >> Apologies if this is a stupid question but it is getting the best of me. >> >> I have a class which contains a GUI object which has serveral text fields >> and buttons which when used trigger the use of further objects which all >> loop through data, the structure is as follows: >> >> class >> def GUI >> GUI calls object1 >> end >> def object1 loops through some data one entry at a time and for each entry >> passes to a new object >> end >> def object2 loops through passed data and does stuff >> end >> then the next bit of data does the same thing in object1 >> >> >> What I need is a gui that pops up when my script runs through all of >> objects for each bit of data. Any ideas? I just need to know when the loop >> is complete, at present I press the go button on my fx GUI and it stays >> pressed in until all processing is done then pops back out. At this point I >> need a Gui. >> >> I hope this makes sense, >> >> Many thanks >> >> >> >> _______________________________________________ >> fxruby-users mailing list >> fxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/fxruby-users >> >> >> >> _______________________________________________ >> fxruby-users mailing list >> fxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/fxruby-users >> > > -- > If you are not the intended recipient, you are hereby notified > that any dissemination, distribution, copying or other use of > this communication is strictly prohibited. If you have > received this communication in error, please notify us > immediately. > > > -----Inline Attachment Follows----- > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > > > _______________________________________________ > 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 kb9agt at gmail.com Wed Mar 3 18:40:55 2010 From: kb9agt at gmail.com (Douglas Allen) Date: Wed, 3 Mar 2010 17:40:55 -0600 Subject: [fxruby-users] Class with looping objects In-Reply-To: <342736.33459.qm@web86606.mail.ird.yahoo.com> References: <39b4b9791003020558r2d0cfce8k131223f101d26edd@mail.gmail.com> <342736.33459.qm@web86606.mail.ird.yahoo.com> Message-ID: I'm too inexperienced with FXRuby to really help you but have you ever worked with the foxGUIb? I can almost see the same things going on but with different approaches. I like that it uses more attribute_reader after building all the widgets. It just has such a nice clean format. here's a simple app: # source generated by foxGUIb 1.0.0 class MainWindow def initialize( parent) construct_widget_tree( parent) init if respond_to? 'init' end def construct_widget_tree( parent) @topwin= FX::MainWindow.new(parent){|w| @MainWindow=w w.wdg_name='MainWindow' w.backColor=Fox::FXRGBA(212,208,200,255) w.width=216 w.hSpacing=0 w.shown=true w.y=167 w.height=218 w.title="MainWindow" w.vSpacing=0 w.x=262 FX::VerticalFrame.new(@MainWindow){|w| @VerticalFrame=w w.wdg_name='VerticalFrame' w.baseColor=Fox::FXRGBA(212,208,200,255) w.backColor=Fox::FXRGBA(212,208,200,255) w.width=216 w.height=218 w.shadowColor=Fox::FXRGBA(139,137,132,255) FX::Button.new(@VerticalFrame){|w| @Button=w w.wdg_name='Button' w.baseColor=Fox::FXRGBA(212,208,200,255) w.text="click to see what happens!" w.backColor=Fox::FXRGBA(212,208,200,255) w.font=FX::Font.new.from_s('Sans|90|0|0|0|0|0').to_FXFont w.width=153 w.height=23 w.shadowColor=Fox::FXRGBA(139,137,132,255) @Button.connect(Fox::SEL_LEFTBUTTONRELEASE){ @Text.appendText "lmb up\n" 0 # this prevents fox from blocking the builtin event handler for leftbuttonpress } @Button.connect(Fox::SEL_LEFTBUTTONPRESS){ @Text.appendText "lmb down\n" 0 # this prevents fox from blocking the builtin event handler for leftbuttonpress } @Button.connect(Fox::SEL_COMMAND){ @Text.appendText "click!\n" } } FX::Text.new(@VerticalFrame){|w| @Text=w w.wdg_name='Text' w.font=FX::Font.new.from_s('Sans|90|0|0|0|0|0').to_FXFont w.width=216 w.selBackColor=Fox::FXRGBA(10,36,106,255) w.y=23 w.height=195 } } } end attr_reader :topwin attr_reader :MainWindow attr_reader :VerticalFrame attr_reader :Button attr_reader :Text end #unit test if __FILE__==$0 require 'libGUIb16' app=FX::App.new w=MainWindow.new app w.topwin.show(Fox::PLACEMENT_SCREEN) app.create app.run end notice require 'libGUIb16' and then it uses 'fox16' or 'fox14' in its' system. I'm amazed at the size of the GUI builder app. Nothing large like Glade or IronRuby. On 3/3/10, Stuart Clarke wrote: > > See code below, many thanks: > > require 'fox16' > include Fox > > require "find" > require "fileutils" > > class ScriptGui < FXMainWindow #SUBCLASS FOR CREATING A WINDOW, CONTAINS > ALL THE CUSTOMISATION INFORMATION > def initialize(app) > super(app, "Script", :width => 700, :height => 200) > frame = FXVerticalFrame.new(self, LAYOUT_LEFT|LAYOUT_FILL_X) > #FRAMES FOR INPUT > frame1 = FXHorizontalFrame.new(frame, > LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) > > > inputFileA = FXButton.new(frame1, "Input File") > inputFileA.connect(SEL_COMMAND) do > #the connect will ensure the following block is performed > dialog = FXFileDialog.new(self, "Select file") > dialog.patternList = ["Text Files (*.txt)", "All Files (*)"] > #recognised file types > dialog.selectMode = SELECTFILE_EXISTING > #select a file > if dialog.execute != 0 > #display the box and wait fot user response > @aInput.text = dialog.filename > #if the user selects a file it write it in inputfield > end > end > @aInput = FXTextField.new(frame1, 90, :opts => > JUSTIFY_LEFT|FRAME_SUNKEN|FRAME_THICK) > > FXHorizontalSeparator.new(frame, :opts => > LAYOUT_FILL_X|SEPARATOR_GROOVE) > > buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, > method(:matcher)) #call method matcher to commence > process > end > > def matcher(sender, sel, ptr) > #set up hash for itemC and doc ID > @hashMapping = Hash.new {|h,k| h[k] = []} > > #process loadfile to capture doc ID's & itemC values. > IO.foreach(@aInput.to_s) do |data| > #go through the input concordance loadfile > fields = data.split(" ") > #split the field on this > itemA = fields[13].delete("?").downcase > > itemB = fields[0].delete("?,\"") > > itemC = fields[35].delete("?,\"") > > if itemA.to_s.downcase == "pdf" > @hashMapping[itemC] << itemB > > end > end > > Find.find(@aInput.to_s) do |curPath2| > > if File.file?(curPath2) and curPath2[/\.txt$/] > itemCFN = File.basename(curPath2, ".txt").strip.to_s.downcase > #grabs the file name stripping whitespace > finditemC(curPath2, itemCFN) > > end > end > end > > def finditemC(curPath2, itemCFN) > > @hashMapping.each do |itemDetail| > @entryArray = [] > > entry = itemDetail.to_s.strip > > @entryArray << itemDetail.to_s.strip > > if entry.match(/#{itemCFN}/) > > puts itemCFN > end > end > end > > def create > super > show(PLACEMENT_SCREEN) > #SHOW THE GUI ON THE SCREEN > end > end > > #CONSTRUCTOR > if __FILE__ == $0 > FXApp.new do |app| > ScriptGui.new(app) > app.create#CALLS THE METHOD CREATE TO ENSURE ALL NEEDED INFO IS ADDED > app.run#STARTS THE CREATION OF THE WINDOWS > end > end > > --- On *Tue, 2/3/10, Joey Kinsella *wrote: > > > From: Joey Kinsella > Subject: Re: [fxruby-users] Class with looping objects > To: fxruby-users at rubyforge.org > Date: Tuesday, 2 March, 2010, 13:58 > > It would be much easier to help you if we could see at least example code > (similar to what your doing.) > However, the error you displayed below tells me your doing something > incorrectly. Are you sure self.close() is really what you want to do? > Perhaps you should try self.hide()/self.show(). I don't know, without actual > code it's hard to tell what you are trying to do. But I hope this helps. > > On Tue, Mar 2, 2010 at 4:34 AM, Stuart Clarke > > wrote: > >> Hi, >> >> Thanks for your reply. >> >> I have tried this previously and I get the following error: >> >> C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/aliases.rb:4812:in >> `getText': This FXTextField * already released (RuntimeError) >> >> Code is: >> >> buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, >> method(:matcher)) >> end >> def matcher(sender, sel, ptr) >> self.close(true) >> #.... >> >> Just to clarify, when matcher runs, it does >> >> Matcher object - get first item and call object2 >> Object2 does stuff and then we go back to object matcher and get the next >> item >> This loop continues until all items have been through both objects then >> once finished the run button pops up again and the processing is done, at >> this point I want a GUI. >> >> Thanks a lot >> >> Stuart >> >> >> --- On *Mon, 1/3/10, Joey Kinsella >> >* wrote: >> >> >> From: Joey Kinsella >> > >> Subject: Re: [fxruby-users] Class with looping objects >> >> To: fxruby-users at rubyforge.org >> Date: Monday, 1 March, 2010, 14:43 >> >> Couldn't you just do: >> >> def initialize >> # ... >> button = FXButton.new(frame, "Run").connect(SEL_COMMAND, >> method(:matcher)) >> # ... >> end >> >> def matcher(sender, selector, data) >> # ... >> self.close # (true) # if you want to notify the messaging system. >> end >> >> or well, something along those lines.. button is a reference to an >> FXButton object, It should never equal SEL_KEYRELEASE in this respect. Also >> the code above is assuming that it's an object which extends FXMainWindow. >> >> Hope this helps, >> -Joey >> >> On Mon, Mar 1, 2010 at 6:09 AM, Stuart Clarke >> > wrote: >> >>> Hi, >>> >>> I have a GUI which triggers an object to do some stuff, when you press >>> the FXButton it calls matcher e.g. >>> >>> button = FXButton.new(frame, "Run").connect(SEL_COMMAND, >>> method(:matcher)) >>> >>> This button remains in a pressed state until the object has finished >>> running, when it is complete the button pops back up. I am trying to add a >>> popup box to respond to the button popping up (or processing finished) like >>> so: >>> >>> if button == SEL_KEYRELEASE >>> FXMessageBox.information(self, MBOX_OK, "Complete") >>> mainwindow.close >>> end >>> >>> This however does not work, any ideas how I can acheive this? >>> >>> Many thanks >>> >>> --- On *Fri, 26/2/10, Stuart Clarke >>> >* wrote: >>> >>> >>> From: Stuart Clarke >>> > >>> Subject: [fxruby-users] Class with looping objects >>> To: fxruby-users at rubyforge.org >>> Date: Friday, 26 February, 2010, 19:38 >>> >>> >>> Hi all, >>> >>> Apologies if this is a stupid question but it is getting the best of me. >>> >>> I have a class which contains a GUI object which has serveral text fields >>> and buttons which when used trigger the use of further objects which all >>> loop through data, the structure is as follows: >>> >>> class >>> def GUI >>> GUI calls object1 >>> end >>> def object1 loops through some data one entry at a time and for each >>> entry passes to a new object >>> end >>> def object2 loops through passed data and does stuff >>> end >>> then the next bit of data does the same thing in object1 >>> >>> >>> What I need is a gui that pops up when my script runs through all of >>> objects for each bit of data. Any ideas? I just need to know when the loop >>> is complete, at present I press the go button on my fx GUI and it stays >>> pressed in until all processing is done then pops back out. At this point I >>> need a Gui. >>> >>> I hope this makes sense, >>> >>> Many thanks >>> >>> >>> >>> _______________________________________________ >>> fxruby-users mailing list >>> fxruby-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/fxruby-users >>> >>> >>> >>> _______________________________________________ >>> fxruby-users mailing list >>> fxruby-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/fxruby-users >>> >> >> -- >> If you are not the intended recipient, you are hereby notified >> that any dissemination, distribution, copying or other use of >> this communication is strictly prohibited. If you have >> received this communication in error, please notify us >> immediately. >> >> >> -----Inline Attachment Follows----- >> >> >> _______________________________________________ >> fxruby-users mailing list >> fxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/fxruby-users >> >> >> >> _______________________________________________ >> fxruby-users mailing list >> fxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/fxruby-users >> > > -- > If you are not the intended recipient, you are hereby notified > that any dissemination, distribution, copying or other use of > this communication is strictly prohibited. If you have > received this communication in error, please notify us > immediately. > > > -----Inline Attachment Follows----- > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > > > _______________________________________________ > 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 kb9agt at gmail.com Wed Mar 3 19:14:06 2010 From: kb9agt at gmail.com (Douglas Allen) Date: Wed, 3 Mar 2010 18:14:06 -0600 Subject: [fxruby-users] Class with looping objects In-Reply-To: References: <39b4b9791003020558r2d0cfce8k131223f101d26edd@mail.gmail.com> <342736.33459.qm@web86606.mail.ird.yahoo.com> Message-ID: here is another little tidbit: theButton.connect(SEL_COMMAND) { puts "You have clicked the button. Good bye!" exit} There are many ways to do blocks. On 3/3/10, Douglas Allen wrote: > > I'm too inexperienced with FXRuby to really help you but have you ever > worked with the foxGUIb? > > I can almost see the same things going on but with different approaches. I > like that it uses more attribute_reader after building all the widgets. It > just has such a nice clean format. here's a simple app: > > # source generated by foxGUIb 1.0.0 > > class MainWindow > def initialize( parent) > construct_widget_tree( parent) > init if respond_to? 'init' > end > > def construct_widget_tree( parent) > @topwin= > FX::MainWindow.new(parent){|w| > @MainWindow=w > w.wdg_name='MainWindow' > w.backColor=Fox::FXRGBA(212,208,200,255) > w.width=216 > w.hSpacing=0 > w.shown=true > w.y=167 > w.height=218 > w.title="MainWindow" > w.vSpacing=0 > w.x=262 > FX::VerticalFrame.new(@MainWindow){|w| > @VerticalFrame=w > w.wdg_name='VerticalFrame' > w.baseColor=Fox::FXRGBA(212,208,200,255) > w.backColor=Fox::FXRGBA(212,208,200,255) > w.width=216 > w.height=218 > w.shadowColor=Fox::FXRGBA(139,137,132,255) > FX::Button.new(@VerticalFrame){|w| > @Button=w > w.wdg_name='Button' > w.baseColor=Fox::FXRGBA(212,208,200,255) > w.text="click to see what happens!" > w.backColor=Fox::FXRGBA(212,208,200,255) > > w.font=FX::Font.new.from_s('Sans|90|0|0|0|0|0').to_FXFont > w.width=153 > w.height=23 > w.shadowColor=Fox::FXRGBA(139,137,132,255) > @Button.connect(Fox::SEL_LEFTBUTTONRELEASE){ > @Text.appendText "lmb up\n" > 0 # this prevents fox from blocking the builtin > event handler for leftbuttonpress > } > @Button.connect(Fox::SEL_LEFTBUTTONPRESS){ > @Text.appendText "lmb down\n" > 0 # this prevents fox from blocking the builtin > event handler for leftbuttonpress > } > @Button.connect(Fox::SEL_COMMAND){ > @Text.appendText "click!\n" > } > } > FX::Text.new(@VerticalFrame){|w| > @Text=w > w.wdg_name='Text' > > w.font=FX::Font.new.from_s('Sans|90|0|0|0|0|0').to_FXFont > w.width=216 > w.selBackColor=Fox::FXRGBA(10,36,106,255) > w.y=23 > w.height=195 > } > } > } > end > attr_reader :topwin > attr_reader :MainWindow > attr_reader :VerticalFrame > attr_reader :Button > attr_reader :Text > end > > #unit test > if __FILE__==$0 > require 'libGUIb16' > app=FX::App.new > w=MainWindow.new app > w.topwin.show(Fox::PLACEMENT_SCREEN) > app.create > app.run > end > > notice require 'libGUIb16' and then it uses 'fox16' or 'fox14' in its' > system. > I'm amazed at the size of the GUI builder app. Nothing large like Glade or > IronRuby. > > > On 3/3/10, Stuart Clarke wrote: >> >> See code below, many thanks: >> >> require 'fox16' >> include Fox >> >> require "find" >> require "fileutils" >> >> class ScriptGui < FXMainWindow #SUBCLASS FOR CREATING A WINDOW, CONTAINS >> ALL THE CUSTOMISATION INFORMATION >> def initialize(app) >> super(app, "Script", :width => 700, :height => 200) >> frame = FXVerticalFrame.new(self, LAYOUT_LEFT|LAYOUT_FILL_X) >> #FRAMES FOR INPUT >> frame1 = FXHorizontalFrame.new(frame, >> LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) >> >> >> inputFileA = FXButton.new(frame1, "Input File") >> inputFileA.connect(SEL_COMMAND) do >> #the connect will ensure the following block is performed >> dialog = FXFileDialog.new(self, "Select file") >> dialog.patternList = ["Text Files (*.txt)", "All Files (*)"] >> #recognised file types >> dialog.selectMode = SELECTFILE_EXISTING >> #select a file >> if dialog.execute != 0 >> #display the box and wait fot user response >> @aInput.text = dialog.filename >> #if the user selects a file it write it in inputfield >> end >> end >> @aInput = FXTextField.new(frame1, 90, :opts => >> JUSTIFY_LEFT|FRAME_SUNKEN|FRAME_THICK) >> >> FXHorizontalSeparator.new(frame, :opts => >> LAYOUT_FILL_X|SEPARATOR_GROOVE) >> >> buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, >> method(:matcher)) #call method matcher to commence >> process >> end >> >> def matcher(sender, sel, ptr) >> #set up hash for itemC and doc ID >> @hashMapping = Hash.new {|h,k| h[k] = []} >> >> #process loadfile to capture doc ID's & itemC values. >> IO.foreach(@aInput.to_s) do |data| >> #go through the input concordance loadfile >> fields = data.split(" ") >> #split the field on this >> itemA = fields[13].delete("?").downcase >> >> itemB = fields[0].delete("?,\"") >> >> itemC = fields[35].delete("?,\"") >> >> if itemA.to_s.downcase == "pdf" >> @hashMapping[itemC] << itemB >> >> end >> end >> >> Find.find(@aInput.to_s) do |curPath2| >> >> if File.file?(curPath2) and curPath2[/\.txt$/] >> itemCFN = File.basename(curPath2, ".txt").strip.to_s.downcase >> #grabs the file name stripping whitespace >> finditemC(curPath2, itemCFN) >> >> end >> end >> end >> >> def finditemC(curPath2, itemCFN) >> >> @hashMapping.each do |itemDetail| >> @entryArray = [] >> >> entry = itemDetail.to_s.strip >> >> @entryArray << itemDetail.to_s.strip >> >> if entry.match(/#{itemCFN}/) >> >> puts itemCFN >> end >> end >> end >> >> def create >> super >> show(PLACEMENT_SCREEN) >> #SHOW THE GUI ON THE SCREEN >> end >> end >> >> #CONSTRUCTOR >> if __FILE__ == $0 >> FXApp.new do |app| >> ScriptGui.new(app) >> app.create#CALLS THE METHOD CREATE TO ENSURE ALL NEEDED INFO IS ADDED >> app.run#STARTS THE CREATION OF THE WINDOWS >> end >> end >> >> --- On *Tue, 2/3/10, Joey Kinsella *wrote: >> >> >> From: Joey Kinsella >> Subject: Re: [fxruby-users] Class with looping objects >> To: fxruby-users at rubyforge.org >> Date: Tuesday, 2 March, 2010, 13:58 >> >> It would be much easier to help you if we could see at least example code >> (similar to what your doing.) >> However, the error you displayed below tells me your doing something >> incorrectly. Are you sure self.close() is really what you want to do? >> Perhaps you should try self.hide()/self.show(). I don't know, without actual >> code it's hard to tell what you are trying to do. But I hope this helps. >> >> On Tue, Mar 2, 2010 at 4:34 AM, Stuart Clarke >> > wrote: >> >>> Hi, >>> >>> Thanks for your reply. >>> >>> I have tried this previously and I get the following error: >>> >>> C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/aliases.rb:4812:in >>> `getText': This FXTextField * already released (RuntimeError) >>> >>> Code is: >>> >>> buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, >>> method(:matcher)) >>> end >>> def matcher(sender, sel, ptr) >>> self.close(true) >>> #.... >>> >>> Just to clarify, when matcher runs, it does >>> >>> Matcher object - get first item and call object2 >>> Object2 does stuff and then we go back to object matcher and get the next >>> item >>> This loop continues until all items have been through both objects then >>> once finished the run button pops up again and the processing is done, at >>> this point I want a GUI. >>> >>> Thanks a lot >>> >>> Stuart >>> >>> >>> --- On *Mon, 1/3/10, Joey Kinsella >>> >* wrote: >>> >>> >>> From: Joey Kinsella >>> > >>> Subject: Re: [fxruby-users] Class with looping objects >>> >>> To: fxruby-users at rubyforge.org >>> Date: Monday, 1 March, 2010, 14:43 >>> >>> Couldn't you just do: >>> >>> def initialize >>> # ... >>> button = FXButton.new(frame, "Run").connect(SEL_COMMAND, >>> method(:matcher)) >>> # ... >>> end >>> >>> def matcher(sender, selector, data) >>> # ... >>> self.close # (true) # if you want to notify the messaging system. >>> end >>> >>> or well, something along those lines.. button is a reference to an >>> FXButton object, It should never equal SEL_KEYRELEASE in this respect. Also >>> the code above is assuming that it's an object which extends FXMainWindow. >>> >>> Hope this helps, >>> -Joey >>> >>> On Mon, Mar 1, 2010 at 6:09 AM, Stuart Clarke >>> > wrote: >>> >>>> Hi, >>>> >>>> I have a GUI which triggers an object to do some stuff, when you press >>>> the FXButton it calls matcher e.g. >>>> >>>> button = FXButton.new(frame, "Run").connect(SEL_COMMAND, >>>> method(:matcher)) >>>> >>>> This button remains in a pressed state until the object has finished >>>> running, when it is complete the button pops back up. I am trying to add a >>>> popup box to respond to the button popping up (or processing finished) like >>>> so: >>>> >>>> if button == SEL_KEYRELEASE >>>> FXMessageBox.information(self, MBOX_OK, "Complete") >>>> mainwindow.close >>>> end >>>> >>>> This however does not work, any ideas how I can acheive this? >>>> >>>> Many thanks >>>> >>>> --- On *Fri, 26/2/10, Stuart Clarke >>>> >* wrote: >>>> >>>> >>>> From: Stuart Clarke >>>> > >>>> Subject: [fxruby-users] Class with looping objects >>>> To: fxruby-users at rubyforge.org >>>> Date: Friday, 26 February, 2010, 19:38 >>>> >>>> >>>> Hi all, >>>> >>>> Apologies if this is a stupid question but it is getting the best of me. >>>> >>>> I have a class which contains a GUI object which has serveral text >>>> fields and buttons which when used trigger the use of further objects which >>>> all loop through data, the structure is as follows: >>>> >>>> class >>>> def GUI >>>> GUI calls object1 >>>> end >>>> def object1 loops through some data one entry at a time and for each >>>> entry passes to a new object >>>> end >>>> def object2 loops through passed data and does stuff >>>> end >>>> then the next bit of data does the same thing in object1 >>>> >>>> >>>> What I need is a gui that pops up when my script runs through all of >>>> objects for each bit of data. Any ideas? I just need to know when the loop >>>> is complete, at present I press the go button on my fx GUI and it stays >>>> pressed in until all processing is done then pops back out. At this point I >>>> need a Gui. >>>> >>>> I hope this makes sense, >>>> >>>> Many thanks >>>> >>>> >>>> >>>> _______________________________________________ >>>> fxruby-users mailing list >>>> fxruby-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/fxruby-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> fxruby-users mailing list >>>> fxruby-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/fxruby-users >>>> >>> >>> -- >>> If you are not the intended recipient, you are hereby notified >>> that any dissemination, distribution, copying or other use of >>> this communication is strictly prohibited. If you have >>> received this communication in error, please notify us >>> >>> immediately. >>> >>> >>> -----Inline Attachment Follows----- >>> >>> >>> _______________________________________________ >>> fxruby-users mailing list >>> fxruby-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/fxruby-users >>> >>> >>> >>> _______________________________________________ >>> fxruby-users mailing list >>> fxruby-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/fxruby-users >>> >> >> -- >> If you are not the intended recipient, you are hereby notified >> that any dissemination, distribution, copying or other use of >> this communication is strictly prohibited. If you have >> received this communication in error, please notify us >> >> immediately. >> >> >> -----Inline Attachment Follows----- >> >> _______________________________________________ >> fxruby-users mailing list >> fxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/fxruby-users >> >> >> >> _______________________________________________ >> 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 kb9agt at gmail.com Wed Mar 3 19:41:31 2010 From: kb9agt at gmail.com (Douglas Allen) Date: Wed, 3 Mar 2010 18:41:31 -0600 Subject: [fxruby-users] Class with looping objects In-Reply-To: References: <39b4b9791003020558r2d0cfce8k131223f101d26edd@mail.gmail.com> <342736.33459.qm@web86606.mail.ird.yahoo.com> Message-ID: I used the tabs in scite here: require 'fox16' include Fox require "find" require "fileutils" #SUBCLASS FOR CREATING A WINDOW, CONTAINS ALL THE CUSTOMISATION INFORMATION class ScriptGui < FXMainWindow def initialize(app) super(app, "Script", :width => 700, :height => 200) frame = FXVerticalFrame.new(self, LAYOUT_LEFT|LAYOUT_FILL_X) #FRAMES FOR INPUT frame1 = FXHorizontalFrame.new(frame, LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) inputFileA = FXButton.new(frame1, "Input File") inputFileA.connect(SEL_COMMAND) do #the connect will ensure the following block is performed dialog = FXFileDialog.new(self, "Select file") dialog.patternList = ["Text Files (*.txt)", "All Files (*)"] #recognised file types dialog.selectMode = SELECTFILE_EXISTING #select a file if dialog.execute != 0 #display the box and wait for user response @aInput.text = dialog.filename #if the user selects a file, write it in inputfield end end @aInput = FXTextField.new(frame1, 90, :opts => JUSTIFY_LEFT|FRAME_SUNKEN|FRAME_THICK) FXHorizontalSeparator.new(frame, :opts => LAYOUT_FILL_X|SEPARATOR_GROOVE) buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, method(:matcher)) #call method matcher to commence process end def matcher(sender, selector, data) #set up hash for itemC and doc ID @hashMapping = Hash.new {|h,k| h[k] = []} #process loadfile to capture doc ID's & itemC values. IO.foreach(@aInput.to_s) do |data| #go through the input concordance loadfile fields = data.split(" ") #split the field on this itemA = fields[13].delete("?").downcase itemB = fields[0].delete("?,\"") itemC = fields[35].delete("?,\"") if itemA.to_s.downcase == "pdf" @hashMapping[itemC] << itemB end end Find.find(@aInput.to_s) do |curPath2| if File.file?(curPath2) and curPath2[/\.txt$/] itemCFN = File.basename(curPath2, ".txt").strip.to_s.downcase #grabs the file name stripping whitespace finditemC(curPath2, itemCFN) end end end def finditemC(curPath2, itemCFN) @hashMapping.each do |itemDetail| @entryArray = [] entry = itemDetail.to_s.strip @entryArray << itemDetail.to_s.strip if entry.match(/#{itemCFN}/) puts itemCFN end end end def create super show(PLACEMENT_SCREEN) #SHOW THE GUI ON THE SCREEN end end #CONSTRUCTOR if __FILE__ == $0 FXApp.new do |app| ScriptGui.new(app) app.create#CALLS THE METHOD CREATE TO ENSURE ALL NEEDED INFO IS ADDED app.run#STARTS THE CREATION OF THE WINDOWS end end and here is the go: >ruby ScriptGui.rb ScriptGui.rb:42:in `matcher': undefined method `delete' for nil:NilClass (NoMethodError) from ScriptGui.rb:40:in `foreach' from ScriptGui.rb:40:in `matcher' from C:/allruby/rubyinstaller/sandbox/ruby18_mingw/lib/ruby/site_ruby/1.8/fox16/responder2.rb:55:in `call' from C:/allruby/rubyinstaller/sandbox/ruby18_mingw/lib/ruby/site_ruby/1.8/fox16/responder2.rb:55:in `onHandleMsg' from ScriptGui.rb:80:in `run' from ScriptGui.rb:80 from C:/allruby/rubyinstaller/sandbox/ruby18_mingw/lib/ruby/site_ruby/1.8/fox16/kwargs.rb:269:in `old_initialize' from C:/allruby/rubyinstaller/sandbox/ruby18_mingw/lib/ruby/site_ruby/1.8/fox16/kwargs.rb:269:in `initialize' from ScriptGui.rb:77:in `new' from ScriptGui.rb:77 >Exit code: 1 On 3/3/10, Douglas Allen wrote: > > here is another little tidbit: > theButton.connect(SEL_COMMAND) { > puts "You have clicked the button. Good bye!" > exit} > There are many ways to do blocks. > > > On 3/3/10, Douglas Allen wrote: >> >> I'm too inexperienced with FXRuby to really help you but have you ever >> worked with the foxGUIb? >> >> I can almost see the same things going on but with different approaches. I >> like that it uses more attribute_reader after building all the widgets. It >> just has such a nice clean format. here's a simple app: >> >> # source generated by foxGUIb 1.0.0 >> >> class MainWindow >> def initialize( parent) >> construct_widget_tree( parent) >> init if respond_to? 'init' >> end >> >> def construct_widget_tree( parent) >> @topwin= >> FX::MainWindow.new(parent){|w| >> @MainWindow=w >> w.wdg_name='MainWindow' >> w.backColor=Fox::FXRGBA(212,208,200,255) >> w.width=216 >> w.hSpacing=0 >> w.shown=true >> w.y=167 >> w.height=218 >> w.title="MainWindow" >> w.vSpacing=0 >> w.x=262 >> FX::VerticalFrame.new(@MainWindow){|w| >> @VerticalFrame=w >> w.wdg_name='VerticalFrame' >> w.baseColor=Fox::FXRGBA(212,208,200,255) >> w.backColor=Fox::FXRGBA(212,208,200,255) >> w.width=216 >> w.height=218 >> w.shadowColor=Fox::FXRGBA(139,137,132,255) >> FX::Button.new(@VerticalFrame){|w| >> @Button=w >> w.wdg_name='Button' >> w.baseColor=Fox::FXRGBA(212,208,200,255) >> w.text="click to see what happens!" >> w.backColor=Fox::FXRGBA(212,208,200,255) >> >> w.font=FX::Font.new.from_s('Sans|90|0|0|0|0|0').to_FXFont >> w.width=153 >> w.height=23 >> w.shadowColor=Fox::FXRGBA(139,137,132,255) >> @Button.connect(Fox::SEL_LEFTBUTTONRELEASE){ >> @Text.appendText "lmb up\n" >> 0 # this prevents fox from blocking the builtin >> event handler for leftbuttonpress >> } >> @Button.connect(Fox::SEL_LEFTBUTTONPRESS){ >> @Text.appendText "lmb down\n" >> 0 # this prevents fox from blocking the builtin >> event handler for leftbuttonpress >> } >> @Button.connect(Fox::SEL_COMMAND){ >> @Text.appendText "click!\n" >> } >> } >> FX::Text.new(@VerticalFrame){|w| >> @Text=w >> w.wdg_name='Text' >> >> w.font=FX::Font.new.from_s('Sans|90|0|0|0|0|0').to_FXFont >> w.width=216 >> w.selBackColor=Fox::FXRGBA(10,36,106,255) >> w.y=23 >> w.height=195 >> } >> } >> } >> end >> attr_reader :topwin >> attr_reader :MainWindow >> attr_reader :VerticalFrame >> attr_reader :Button >> attr_reader :Text >> end >> >> #unit test >> if __FILE__==$0 >> require 'libGUIb16' >> app=FX::App.new >> w=MainWindow.new app >> w.topwin.show(Fox::PLACEMENT_SCREEN) >> app.create >> app.run >> end >> >> notice require 'libGUIb16' and then it uses 'fox16' or 'fox14' in its' >> system. >> I'm amazed at the size of the GUI builder app. Nothing large like Glade or >> IronRuby. >> >> >> On 3/3/10, Stuart Clarke wrote: >>> >>> See code below, many thanks: >>> >>> require 'fox16' >>> include Fox >>> >>> require "find" >>> require "fileutils" >>> >>> class ScriptGui < FXMainWindow #SUBCLASS FOR CREATING A WINDOW, CONTAINS >>> ALL THE CUSTOMISATION INFORMATION >>> def initialize(app) >>> super(app, "Script", :width => 700, :height => 200) >>> frame = FXVerticalFrame.new(self, LAYOUT_LEFT|LAYOUT_FILL_X) >>> #FRAMES FOR INPUT >>> frame1 = FXHorizontalFrame.new(frame, >>> LAYOUT_SIDE_TOP|FRAME_NONE|LAYOUT_FILL_X|LAYOUT_FILL_Y) >>> >>> >>> inputFileA = FXButton.new(frame1, "Input File") >>> inputFileA.connect(SEL_COMMAND) do >>> #the connect will ensure the following block is performed >>> dialog = FXFileDialog.new(self, "Select file") >>> dialog.patternList = ["Text Files (*.txt)", "All Files (*)"] >>> #recognised file types >>> dialog.selectMode = SELECTFILE_EXISTING >>> #select a file >>> if dialog.execute != 0 >>> #display the box and wait fot user response >>> @aInput.text = dialog.filename >>> #if the user selects a file it write it in inputfield >>> end >>> end >>> @aInput = FXTextField.new(frame1, 90, :opts => >>> JUSTIFY_LEFT|FRAME_SUNKEN|FRAME_THICK) >>> >>> FXHorizontalSeparator.new(frame, :opts => >>> LAYOUT_FILL_X|SEPARATOR_GROOVE) >>> >>> buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, >>> method(:matcher)) #call method matcher to commence >>> process >>> end >>> >>> def matcher(sender, sel, ptr) >>> #set up hash for itemC and doc ID >>> @hashMapping = Hash.new {|h,k| h[k] = []} >>> >>> #process loadfile to capture doc ID's & itemC values. >>> IO.foreach(@aInput.to_s) do |data| >>> #go through the input concordance loadfile >>> fields = data.split(" ") >>> #split the field on this >>> itemA = fields[13].delete("?").downcase >>> >>> itemB = fields[0].delete("?,\"") >>> >>> itemC = fields[35].delete("?,\"") >>> >>> if itemA.to_s.downcase == "pdf" >>> @hashMapping[itemC] << itemB >>> >>> end >>> end >>> >>> Find.find(@aInput.to_s) do |curPath2| >>> >>> if File.file?(curPath2) and curPath2[/\.txt$/] >>> itemCFN = File.basename(curPath2, ".txt").strip.to_s.downcase >>> #grabs the file name stripping whitespace >>> finditemC(curPath2, itemCFN) >>> >>> end >>> end >>> end >>> >>> def finditemC(curPath2, itemCFN) >>> >>> @hashMapping.each do |itemDetail| >>> @entryArray = [] >>> >>> entry = itemDetail.to_s.strip >>> >>> @entryArray << itemDetail.to_s.strip >>> >>> if entry.match(/#{itemCFN}/) >>> >>> puts itemCFN >>> end >>> end >>> end >>> >>> def create >>> super >>> show(PLACEMENT_SCREEN) >>> #SHOW THE GUI ON THE SCREEN >>> end >>> end >>> >>> #CONSTRUCTOR >>> if __FILE__ == $0 >>> FXApp.new do |app| >>> ScriptGui.new(app) >>> app.create#CALLS THE METHOD CREATE TO ENSURE ALL NEEDED INFO IS ADDED >>> app.run#STARTS THE CREATION OF THE WINDOWS >>> end >>> end >>> >>> --- On *Tue, 2/3/10, Joey Kinsella *wrote: >>> >>> >>> From: Joey Kinsella >>> Subject: Re: [fxruby-users] Class with looping objects >>> To: fxruby-users at rubyforge.org >>> Date: Tuesday, 2 March, 2010, 13:58 >>> >>> It would be much easier to help you if we could see at least example code >>> (similar to what your doing.) >>> However, the error you displayed below tells me your doing something >>> incorrectly. Are you sure self.close() is really what you want to do? >>> Perhaps you should try self.hide()/self.show(). I don't know, without actual >>> code it's hard to tell what you are trying to do. But I hope this helps. >>> >>> On Tue, Mar 2, 2010 at 4:34 AM, Stuart Clarke >>> > wrote: >>> >>>> Hi, >>>> >>>> Thanks for your reply. >>>> >>>> I have tried this previously and I get the following error: >>>> >>>> C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/aliases.rb:4812:in >>>> `getText': This FXTextField * already released (RuntimeError) >>>> >>>> Code is: >>>> >>>> buttonCode = FXButton.new(frame, "Run").connect(SEL_COMMAND, >>>> method(:matcher)) >>>> end >>>> def matcher(sender, sel, ptr) >>>> self.close(true) >>>> #.... >>>> >>>> Just to clarify, when matcher runs, it does >>>> >>>> Matcher object - get first item and call object2 >>>> Object2 does stuff and then we go back to object matcher and get the >>>> next item >>>> This loop continues until all items have been through both objects then >>>> once finished the run button pops up again and the processing is done, at >>>> this point I want a GUI. >>>> >>>> Thanks a lot >>>> >>>> Stuart >>>> >>>> >>>> --- On *Mon, 1/3/10, Joey Kinsella >>>> >* wrote: >>>> >>>> >>>> From: Joey Kinsella >>>> > >>>> Subject: Re: [fxruby-users] Class with looping objects >>>> >>>> To: fxruby-users at rubyforge.org >>>> Date: Monday, 1 March, 2010, 14:43 >>>> >>>> Couldn't you just do: >>>> >>>> def initialize >>>> # ... >>>> button = FXButton.new(frame, "Run").connect(SEL_COMMAND, >>>> method(:matcher)) >>>> # ... >>>> end >>>> >>>> def matcher(sender, selector, data) >>>> # ... >>>> self.close # (true) # if you want to notify the messaging system. >>>> end >>>> >>>> or well, something along those lines.. button is a reference to an >>>> FXButton object, It should never equal SEL_KEYRELEASE in this respect. Also >>>> the code above is assuming that it's an object which extends FXMainWindow. >>>> >>>> Hope this helps, >>>> -Joey >>>> >>>> On Mon, Mar 1, 2010 at 6:09 AM, Stuart Clarke < >>>> stuart_clarke86 at yahoo.com >>>> > wrote: >>>> >>>>> Hi, >>>>> >>>>> I have a GUI which triggers an object to do some stuff, when you press >>>>> the FXButton it calls matcher e.g. >>>>> >>>>> button = FXButton.new(frame, "Run").connect(SEL_COMMAND, >>>>> method(:matcher)) >>>>> >>>>> This button remains in a pressed state until the object has finished >>>>> running, when it is complete the button pops back up. I am trying to add a >>>>> popup box to respond to the button popping up (or processing finished) like >>>>> so: >>>>> >>>>> if button == SEL_KEYRELEASE >>>>> FXMessageBox.information(self, MBOX_OK, "Complete") >>>>> mainwindow.close >>>>> end >>>>> >>>>> This however does not work, any ideas how I can acheive this? >>>>> >>>>> Many thanks >>>>> >>>>> --- On *Fri, 26/2/10, Stuart Clarke >>>>> >* wrote: >>>>> >>>>> >>>>> From: Stuart Clarke >>>>> > >>>>> Subject: [fxruby-users] Class with looping objects >>>>> To: fxruby-users at rubyforge.org >>>>> Date: Friday, 26 February, 2010, 19:38 >>>>> >>>>> >>>>> Hi all, >>>>> >>>>> Apologies if this is a stupid question but it is getting the best of >>>>> me. >>>>> >>>>> I have a class which contains a GUI object which has serveral text >>>>> fields and buttons which when used trigger the use of further objects which >>>>> all loop through data, the structure is as follows: >>>>> >>>>> class >>>>> def GUI >>>>> GUI calls object1 >>>>> end >>>>> def object1 loops through some data one entry at a time and for each >>>>> entry passes to a new object >>>>> end >>>>> def object2 loops through passed data and does stuff >>>>> end >>>>> then the next bit of data does the same thing in object1 >>>>> >>>>> >>>>> What I need is a gui that pops up when my script runs through all of >>>>> objects for each bit of data. Any ideas? I just need to know when the loop >>>>> is complete, at present I press the go button on my fx GUI and it stays >>>>> pressed in until all processing is done then pops back out. At this point I >>>>> need a Gui. >>>>> >>>>> I hope this makes sense, >>>>> >>>>> Many thanks >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fxruby-users mailing list >>>>> fxruby-users at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/fxruby-users >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> fxruby-users mailing list >>>>> fxruby-users at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/fxruby-users >>>>> >>>> >>>> -- >>>> If you are not the intended recipient, you are hereby notified >>>> that any dissemination, distribution, copying or other use of >>>> this communication is strictly prohibited. If you have >>>> received this communication in error, please notify us >>>> >>>> >>>> immediately. >>>> >>>> >>>> -----Inline Attachment Follows----- >>>> >>>> >>>> _______________________________________________ >>>> fxruby-users mailing list >>>> fxruby-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/fxruby-users >>>> >>>> >>>> >>>> _______________________________________________ >>>> fxruby-users mailing list >>>> fxruby-users at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/fxruby-users >>>> >>> >>> -- >>> If you are not the intended recipient, you are hereby notified >>> that any dissemination, distribution, copying or other use of >>> this communication is strictly prohibited. If you have >>> received this communication in error, please notify us >>> >>> >>> immediately. >>> >>> >>> -----Inline Attachment Follows----- >>> >>> _______________________________________________ >>> fxruby-users mailing list >>> fxruby-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/fxruby-users >>> >>> >>> >>> _______________________________________________ >>> 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 tester.paul at gmail.com Thu Mar 11 23:19:44 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Thu, 11 Mar 2010 23:19:44 -0500 Subject: [fxruby-users] foxGUIb GUI and code separation question Message-ID: <37c405481003112019x24c51800g961393d34b07def7@mail.gmail.com> Hi there, I created the sample program from the foxGUIb guide and it worked okay. Then I tried the example where the GUI and code are separated (i.e. see http://www.mikeparr.info/rubyguib/firstprog.htm ) but I can't get it to work. When I run the ExtendInches.rb script (exact code on the above page), I get the following error: ---- >rubyw ExtendInches.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- FX (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from ExtendInches.rb:15 >Exit code: 1 ---- What am I missing? I tried changing the "#unit test" code to match the code from the InchesX.rb script but then I get a different error - still doesn't work. Please help. TIA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dglnz at yahoo.com Fri Mar 12 01:38:22 2010 From: dglnz at yahoo.com (dave L) Date: Thu, 11 Mar 2010 22:38:22 -0800 (PST) Subject: [fxruby-users] foxGUIb GUI and code separation question In-Reply-To: <37c405481003112019x24c51800g961393d34b07def7@mail.gmail.com> References: <37c405481003112019x24c51800g961393d34b07def7@mail.gmail.com> Message-ID: <771401.99242.qm@web30006.mail.mud.yahoo.com> Hi Paul, I too use foxGUIb. Mienrad (Henon) has help me lots with a project I've been working no in the last year and I intend to do some screen casts to showcase problems I've been working on over the past year and how to to correct them. the first thing you need to look at is this bit of code (text taken from the site you mentioned) with comments added by me. require "InchesX" # this being the foxGUIb generated source file - the .rb file. # here you need to subclass the foxGUIb generated code # So if you called you generated code inches.rb then change the class line to # class InchesX < inches. # Of course you will also need to have a require above this SO... # on 1st line you'll have require 'inches.rb' - the .rb may not be needed!! # # this is the 1st thing - subclassing YOU'RE event handling code from the GUI code. # class InchesX #events def init # each of the control names MUST be found in the GUIb generated source! convertButton.connect(SEL_COMMAND){ cmLabel.text=(inchesField.text.to_f * 2.54 ).to_s } end # of events end #unit test if __FILE__==$0 require 'FX' app=App.new # This line was something that got me good! # ALWAYS REMEMBER if cutting and pasting to change this # line below to the class name of your event handling code - I ALWAY FORGOT # until after a few programs! w=InchesX.new app w.topwin.show(0) app.create app.run end Hope this helps, Google for foxGUIb and you'll see a lot of posting from me regarding issues I've had and i hope will help you with problems you may face and from googling learn from my mistakes HTH ps Paul i have sent a private email to you with a sample program that works to help you see things hope fully better. ________________________________ From: Paul Carvalho To: fxruby-users at rubyforge.org Sent: Fri, 12 March, 2010 5:19:44 PM Subject: [fxruby-users] foxGUIb GUI and code separation question Hi there, I created the sample program from the foxGUIb guide and it worked okay. Then I tried the example where the GUI and code are separated (i.e. see http://www.mikeparr.info/rubyguib/firstprog.htm ) but I can't get it to work. When I run the ExtendInches.rb script (exact code on the above page), I get the following error: ---- >rubyw ExtendInches.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- FX (LoadError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from ExtendInches.rb:15 >Exit code: 1 ---- What am I missing? I tried changing the "#unit test" code to match the code from the InchesX.rb script but then I get a different error - still doesn't work. Please help. TIA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tester.paul at gmail.com Fri Mar 12 11:04:13 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Fri, 12 Mar 2010 11:04:13 -0500 Subject: [fxruby-users] foxGUIb GUI and code separation question In-Reply-To: <771401.99242.qm@web30006.mail.mud.yahoo.com> References: <37c405481003112019x24c51800g961393d34b07def7@mail.gmail.com> <771401.99242.qm@web30006.mail.mud.yahoo.com> Message-ID: <37c405481003120804w29e5665bm39a2a7b37c96d3a@mail.gmail.com> Hello Dave, thank you for your reply. The sample code you sent in your private reply helped me fix the code to make it work. Here's a summary of what I tried and did until I got it to work: 1) original code from the web site didn't work. - when I ran it, I get the error: "no such file to load -- FX (LoadError)" => The problem seems to be with the "require 'FX'" line - I noticed in your sample program you included the same lines from your GUI script, so I changed the following lines from: require 'FX' app=App.new to: require 'libGUIb16' app=FX::App.new -> And now I don't get the "cannot load file" error. 2) File loads, code still doesn't work. Now when I run the ExtendsInches.rb script, I get the following error: ---- >rubyw ExtendInches.rb ExtendInches.rb:6:in `init': uninitialized constant InchesX::SEL_COMMAND (NameError) from ./InchesX.rb:6:in `initialize' from ExtendInches.rb:19:in `new' from ExtendInches.rb:19 >Exit code: 1 ---- -> This is where the sample code you sent in your follow-up reply really helped me. I changed the following line from: convertButton.connect(SEL_COMMAND){ to: convertButton.connect(Fox::SEL_COMMAND){ -> and now the script works!!! =) Someone should probably update the code in the foxGUIb guide. This was very frustrating to try and figure out. Thanks for your help! Cheers! Paul. On 12 March 2010 01:38, dave L wrote: > Hi Paul, > > I too use foxGUIb. > > Mienrad (Henon) has help me lots with a project I've been working no in the > last year and I intend to do some screen casts to showcase problems I've > been working on over the past year and how to to correct them. > > [snip] > Hope this helps, Google for foxGUIb and you'll see a lot of posting from me > regarding issues I've had and i hope will help you with problems you may > face and from googling learn from my mistakes > > HTH > > ps Paul i have sent a private email to you with a sample program that works > to help you see things hope fully better. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Fri Mar 12 12:58:52 2010 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Fri, 12 Mar 2010 18:58:52 +0100 Subject: [fxruby-users] foxGUIb GUI and code separation question In-Reply-To: <37c405481003120804w29e5665bm39a2a7b37c96d3a@mail.gmail.com> References: <37c405481003112019x24c51800g961393d34b07def7@mail.gmail.com> <771401.99242.qm@web30006.mail.mud.yahoo.com> <37c405481003120804w29e5665bm39a2a7b37c96d3a@mail.gmail.com> Message-ID: <43d756721003120958u3ae95607w7c3daf659a53359@mail.gmail.com> Hi Paul, Thanks for giving detailed feedback about the errors in the guide. I notified the author and forwarded your mail to him. Best wishes, -- henon On Fri, Mar 12, 2010 at 5:04 PM, Paul Carvalho wrote: > Hello Dave, thank you for your reply. The sample code you sent in your > private reply helped me fix the code to make it work. > > Here's a summary of what I tried and did until I got it to work: > > 1) original code from the web site didn't work. > - when I ran it, I get the error: "no such file to load -- FX (LoadError)" > > => The problem seems to be with the "require 'FX'" line > > - I noticed in your sample program you included the same lines from your > GUI script, so I changed the following lines from: > > > require 'FX' > app=App.new > > to: > require 'libGUIb16' > app=FX::App.new > > -> And now I don't get the "cannot load file" error. > > 2) File loads, code still doesn't work. Now when I run the > ExtendsInches.rb script, I get the following error: > ---- > >rubyw ExtendInches.rb > ExtendInches.rb:6:in `init': uninitialized constant InchesX::SEL_COMMAND > (NameError) > from ./InchesX.rb:6:in `initialize' > from ExtendInches.rb:19:in `new' > from ExtendInches.rb:19 > >Exit code: 1 > ---- > > -> This is where the sample code you sent in your follow-up reply really > helped me. > I changed the following line from: > > convertButton.connect(SEL_COMMAND){ > > to: > convertButton.connect(Fox::SEL_COMMAND){ > > -> and now the script works!!! =) > > Someone should probably update the code in the foxGUIb guide. This was > very frustrating to try and figure out. > > Thanks for your help! Cheers! Paul. > > > On 12 March 2010 01:38, dave L wrote: > >> Hi Paul, >> >> I too use foxGUIb. >> >> Mienrad (Henon) has help me lots with a project I've been working no in >> the last year and I intend to do some screen casts to showcase problems I've >> been working on over the past year and how to to correct them. >> >> [snip] > >> Hope this helps, Google for foxGUIb and you'll see a lot of posting from >> me regarding issues I've had and i hope will help you with problems you may >> face and from googling learn from my mistakes >> >> HTH >> >> ps Paul i have sent a private email to you with a sample program that >> works to help you see things hope fully better. >> > > > _______________________________________________ > 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 dglnz at yahoo.com Fri Mar 12 23:15:55 2010 From: dglnz at yahoo.com (dave L) Date: Fri, 12 Mar 2010 20:15:55 -0800 (PST) Subject: [fxruby-users] foxGUIb GUI and code separation question In-Reply-To: <37c405481003120804w29e5665bm39a2a7b37c96d3a@mail.gmail.com> References: <37c405481003112019x24c51800g961393d34b07def7@mail.gmail.com> <771401.99242.qm@web30006.mail.mud.yahoo.com> <37c405481003120804w29e5665bm39a2a7b37c96d3a@mail.gmail.com> Message-ID: <1833.63880.qm@web30008.mail.mud.yahoo.com> Should have seen the error myself. Well you can see why i have so many posts floating around the web As I've said I intended to at sometime post a screen cast showing things like that which are gotchas for people new to fxruby and have found and like the foxGUIb. If i can help please holler, but also post on the list as others may also help and faster than I. cheers, Glad what i did has helped you. ________________________________ From: Paul Carvalho To: fxruby-users at rubyforge.org Sent: Sat, 13 March, 2010 5:04:13 AM Subject: Re: [fxruby-users] foxGUIb GUI and code separation question Hello Dave, thank you for your reply. The sample code you sent in your private reply helped me fix the code to make it work. Here's a summary of what I tried and did until I got it to work: 1) original code from the web site didn't work. - when I ran it, I get the error: "no such file to load -- FX (LoadError)" => The problem seems to be with the "require 'FX'" line - I noticed in your sample program you included the same lines from your GUI script, so I changed the following lines from: require 'FX' app=App.new to: require 'libGUIb16' app=FX::App.new -> And now I don't get the "cannot load file" error. 2) File loads, code still doesn't work. Now when I run the ExtendsInches.rb script, I get the following error: ---- >rubyw ExtendInches.rb ExtendInches.rb:6:in `init': uninitialized constant InchesX::SEL_COMMAND (NameError) from ./InchesX.rb:6:in `initialize' from ExtendInches.rb:19:in `new' from ExtendInches.rb:19 >Exit code: 1 ---- -> This is where the sample code you sent in your follow-up reply really helped me. I changed the following line from: convertButton.connect(SEL_COMMAND){ to: convertButton.connect(Fox::SEL_COMMAND){ -> and now the script works!!! =) Someone should probably update the code in the foxGUIb guide. This was very frustrating to try and figure out. Thanks for your help! Cheers! Paul. On 12 March 2010 01:38, dave L wrote: Hi Paul, > >I too use foxGUIb. > > >Mienrad (Henon) has help me lots with a project I've been working no in the last year and I intend to do some screen casts to showcase problems I've been working on over the past year and how to to correct them. > > [snip] Hope this helps, Google for foxGUIb and you'll see a lot of posting from me regarding issues I've had and i > hope will help you with problems you may face and from googling learn from my mistakes > >HTH > >ps Paul i have sent a private email to you with a sample program that works to help you see things hope fully better. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wbparsons at cshore.com Tue Mar 16 21:04:13 2010 From: wbparsons at cshore.com (Will Parsons) Date: Tue, 16 Mar 2010 21:04:13 -0400 (EDT) Subject: [fxruby-users] getting text being entered into an FXTable cell Message-ID: <20100316.210413.131929651.wbparsons@cshore.com> I have an application that uses an FXTable widget, and when the contents of a cell is being edited, I want to anticipate what the user wishes to enter (by matching the text with a previous entry), and present that for completion. (This is similar to how Excel works.) I've attempted to do this by using the FXTable getItem(currentRow, currentColumn).text method when a SEL_KEYRELEASE message is received, but this gets the previous text of the cell, rather than the text that is currently being entered. I could of course collect the keys pressed in response to SEL_KEYRELEASE in a private buffer, but this would mean I would have to do complicated processing of the keys entered, which must be already being done elsewhere? -- Will From Alex.Decaria at millersville.edu Tue Mar 16 21:58:01 2010 From: Alex.Decaria at millersville.edu (Alex DeCaria) Date: Tue, 16 Mar 2010 21:58:01 -0400 Subject: [fxruby-users] Continuing to get random segmentation fault with .fillItem method Message-ID: I'm continuing to get random segmentation faults, usually when using the fillItems method on a listBox. The problem is very random. Sometimes the program will run for a while without a problem, but then at some point it crashes while calling fillItems. I did an internet search and found a post from two years ago on a different forum from someone having the exact same problem (see http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/282884). I haven't been able to find if/how they resolved it. Unfortunately, it's making me rethink the whole FXRuby route for creating GUI's, which is too bad because I really like it otherwise. Can anybody shed some light on this? I've attached my code (I've completely reworked it, and gone over it several times and don't see anything I'm doing that would cause it to segmentation fault). --Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unit_converter_FX-nonobject.rb Type: application/octet-stream Size: 6492 bytes Desc: unit_converter_FX-nonobject.rb URL: From tester.paul at gmail.com Mon Mar 22 14:58:00 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Mon, 22 Mar 2010 14:58:00 -0400 Subject: [fxruby-users] How do you enable a button for any option change in UI? Message-ID: <37c405481003221158g53cca526nf96011b42a42aa22@mail.gmail.com> I have an app that has 2 basic purposes: (1) configure options, (2) generate report. Imagine a simple layout - for example, the standard FXRuby "button.rb" script. In addition to the elements on that app, I have another button called "Save configuration". What I want to do is this: the 'save config' button is disabled by default when you start the app. If the user makes *any* change to any of the options, I want the 'save config' button to automatically enable. Of course, that's my first problem. Once I've figured out that part, I'll need to figure out how to read & write the options to a separate file. Any help someone can provide me with this problem would be greatly appreciated. Again, feel free to use the button.rb script as a working example, because that's what I'm using to try and figure this out. Thanks. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Mon Mar 22 16:10:08 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Mon, 22 Mar 2010 15:10:08 -0500 Subject: [fxruby-users] How do you enable a button for any option change in UI? In-Reply-To: <37c405481003221158g53cca526nf96011b42a42aa22@mail.gmail.com> References: <37c405481003221158g53cca526nf96011b42a42aa22@mail.gmail.com> Message-ID: <57cf8f721003221310k31ff908q168c21033bd6d18c@mail.gmail.com> On Mon, Mar 22, 2010 at 1:58 PM, Paul Carvalho wrote: > What I want to do is this: the 'save config' button is disabled by default > when you start the app.? If the user makes *any* change to any of the > options, I want the 'save config' button to automatically enable. For that kind of situation, I'd attach a SEL_UPDATE handler to the "Save Config" button: @save_config_button.connect(SEL_UPDATE) do if @config_changed @save_config_button.enable else @save_config_button.disable end end Elsewhere in my code, I'd set @config_changed to false whenever the user clicked "Save Config", or to false whenever they made a change to one of the config values. > Of course, that's my first problem.? Once I've figured out that part, I'll > need to figure out how to read & write the options to a separate file.? Any > help someone can provide me with this problem would be greatly appreciated. > Again, feel free to use the button.rb script as a working example, because > that's what I'm using to try and figure this out. That sounds like a good job for the registry (FXRegistry) service. From dglnz at yahoo.com Mon Mar 22 16:54:42 2010 From: dglnz at yahoo.com (dave L) Date: Mon, 22 Mar 2010 13:54:42 -0700 (PDT) Subject: [fxruby-users] How do you enable a button for any option change in UI? In-Reply-To: <37c405481003221158g53cca526nf96011b42a42aa22@mail.gmail.com> Message-ID: <987478.27943.qm@web30006.mail.mud.yahoo.com> Hi Paul, you need to have this sort of thing. have 2 buttons 1 enabled 1 not & when you click on the enabled button you disable it and enable the other. there could be better ways but this I hope shows you how in a simple fashion. def init @button1.enabled = false @button2.connect(Fox::SEL_COMMAND){ @button1.enabled = true @button2.enabled = false } @button1.connect(Fox::SEL_COMMAND){ @button2.enabled = true @button1.enabled = false } end if you want send via private email what you have and I can try to help you or do something to get you going. in regards to writing to file try this... this always OVER WRITES the data file. a+ appends onto the end of the file - all in the Rdocs for ruby 1.X.x out = File.new('config.dat',"w+") out.write "this is put to the config file\n" out.write "this is another line in the config file\n" out.write "this is a 3rd line" out.write "Is this a 4th line?" out.close now what you should see if something like this (if i have it right - thinking off the cuff here :) this is put to the config file this is another line in the config file this is a 3rd lineIs this a 4th line? The '\n' is the newline character you need to put in to have a newline appear in the disk file. HTH --- On Tue, 23/3/10, Paul Carvalho wrote: > From: Paul Carvalho > Subject: [fxruby-users] How do you enable a button for any option change in UI? > To: fxruby-users at rubyforge.org > Received: Tuesday, 23 March, 2010, 7:58 AM > I have an app that has 2 basic purposes: > (1) configure options, (2) generate report.? Imagine a > simple layout - for example, the standard FXRuby > "button.rb" script.? In addition to the elements > on that app, I have another button called "Save > configuration". > > > What I want to do is this: the 'save config' button > is disabled by default when you start the app.? If the user > makes *any* change to any of the options, I want the > 'save config' button to automatically enable. > > > Of course, that's my first problem.? Once I've > figured out that part, I'll need to figure out how to > read & write the options to a separate file.? Any help > someone can provide me with this problem would be greatly > appreciated.? Again, feel free to use the button.rb script > as a working example, because that's what I'm using > to try and figure this out. > > > Thanks.? Paul. > > > #yiv1224944298 #avg_ls_inline_popup > {padding:0px > 0px;margin-left:0px;margin-top:0px;width:240px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:13px;} > > -----Inline Attachment Follows----- > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users From tester.paul at gmail.com Mon Mar 22 18:12:22 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Mon, 22 Mar 2010 18:12:22 -0400 Subject: [fxruby-users] Quitting Extended app via button produces errors Message-ID: <37c405481003221512n3ce53c5av110032e6a008f5cf@mail.gmail.com> Hi there, I used foxGUIb to create a UI and a separate file to hold the event actions. When I try to quit the app (see source code below) using a [Quit] button, I get the following error: ----- >rubyw extended_quit.rb extended_quit.rb:5:in `init': uninitialized constant MainWindow::FXApp (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.12-mswin32/lib/fox16/responder2.rb:55:in `call' from c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.12-mswin32/lib/fox16/responder2.rb:55:in `onHandleMsg' from extended_quit.rb:15:in `run' from extended_quit.rb:15 >Exit code: 1 ----- => Question: How do I get the app to quit/exit without showing this error? When I work with a straight FXRuby app (e.g. hello.rb), the app exits without any error. I have tried several ways to try to get the app to quit, and while the error message may change, I can't get the error message to go away and just exit cleanly (0). Please let me know. Thanks. Paul. Here is the code: (1) extended_quit.rb: ----- require "quit_ui" class MainWindow def init button1.connect(Fox::SEL_COMMAND){ FXApp::ID_QUIT } end # of events end if __FILE__==$0 require 'libGUIb16' app=FX::App.new w=MainWindow.new app w.topwin.show(Fox::PLACEMENT_SCREEN) app.create app.run end ----- (2) quit_ui.rb: ----- # source generated by foxGUIb 1.0.0 class MainWindow def initialize( parent) construct_widget_tree( parent) init if respond_to? 'init' end def construct_widget_tree( parent) @topwin= FX::MainWindow.new(parent){|w| @mainWindow=w w.wdg_name='mainWindow' w.width=300 w.shown=true w.y=233 w.height=100 w.x=55 FX::Button.new(@mainWindow){|w| @button1=w w.wdg_name='button1' w.text="Quit" w.width=50 w.height=30 } } end attr_reader :topwin attr_reader :mainWindow attr_reader :button1 end ----- -------------- next part -------------- An HTML attachment was scrubbed... URL: From tester.paul at gmail.com Mon Mar 22 23:36:10 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Mon, 22 Mar 2010 23:36:10 -0400 Subject: [fxruby-users] foxGUIb - how do you insert a title bar icon? Message-ID: <37c405481003222036r21d9691bm9894b83e782c75c8@mail.gmail.com> I've been guessing at this for a few hours now with no luck. Using FoxGUIb, how do you add an icon/image to the title bar of the MainWindow? I know a few ways to do this using FXRuby, but I can't get it with the FoxGUIb-generated UI. TIA. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tester.paul at gmail.com Tue Mar 23 00:11:19 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 23 Mar 2010 00:11:19 -0400 Subject: [fxruby-users] How do you enable a button for any option change in UI? In-Reply-To: <57cf8f721003221310k31ff908q168c21033bd6d18c@mail.gmail.com> References: <37c405481003221158g53cca526nf96011b42a42aa22@mail.gmail.com> <57cf8f721003221310k31ff908q168c21033bd6d18c@mail.gmail.com> Message-ID: <37c405481003222111v328bcaa8nb7b35c0dab3dcee@mail.gmail.com> Thanks for the reply, Lyle. On 22 March 2010 16:10, Lyle Johnson wrote: > > Elsewhere in my code, I'd set @config_changed to false whenever the > user clicked "Save Config", or to false whenever they made a change to > one of the config values. > This is the part that I wanted help with. How does the app know if/when _any_ option has changed? Do I need to iterate through every option and check for status change? Is there a method that tells me when an object has changed from when it was first drawn/created? > > That sounds like a good job for the registry (FXRegistry) service. > Interesting. I found some info at http://www.fox-toolkit.com/registry.htmlbut no examples that I can learn from. Do you know of any examples? I like using the button.rb script for testing with. If I can figure out how to load/save the settings for that program, I should be able to transfer it to my app. Please let me know. Thanks. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Tue Mar 23 05:44:35 2010 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Tue, 23 Mar 2010 10:44:35 +0100 Subject: [fxruby-users] foxGUIb - how do you insert a title bar icon? In-Reply-To: <37c405481003222036r21d9691bm9894b83e782c75c8@mail.gmail.com> References: <37c405481003222036r21d9691bm9894b83e782c75c8@mail.gmail.com> Message-ID: <43d756721003230244y37c5b039xe55a870f129b600f@mail.gmail.com> Hi Paul, Just, do it as you would do it with FXRuby using the instance of the FXRuby mainwindow. IIRC a variable called @topwin is generated by foxguib where you can access it. -- henon On Tue, Mar 23, 2010 at 4:36 AM, Paul Carvalho wrote: > I've been guessing at this for a few hours now with no luck. > > Using FoxGUIb, how do you add an icon/image to the title bar of the > MainWindow? > > I know a few ways to do this using FXRuby, but I can't get it with the > FoxGUIb-generated UI. > > TIA. Paul. > > > _______________________________________________ > 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 Mar 23 09:46:10 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 23 Mar 2010 08:46:10 -0500 Subject: [fxruby-users] How do you enable a button for any option change in UI? In-Reply-To: <37c405481003222111v328bcaa8nb7b35c0dab3dcee@mail.gmail.com> References: <37c405481003221158g53cca526nf96011b42a42aa22@mail.gmail.com> <57cf8f721003221310k31ff908q168c21033bd6d18c@mail.gmail.com> <37c405481003222111v328bcaa8nb7b35c0dab3dcee@mail.gmail.com> Message-ID: <57cf8f721003230646ja2a7b7l179d34214b9b6ae3@mail.gmail.com> On Mon, Mar 22, 2010 at 11:11 PM, Paul Carvalho wrote: > On 22 March 2010 16:10, Lyle Johnson wrote: >> >> Elsewhere in my code, I'd set @config_changed to false whenever the >> user clicked "Save Config", or to false whenever they made a change to >> one of the config values. > > This is the part that I wanted help with.? How does the app know if/when > _any_ option has changed?? Do I need to iterate through every option and > check for status change?? Is there a method that tells me when an object has > changed from when it was first drawn/created? Almost every widget that can be "clicked" sends a SEL_COMMAND message to its target whenever it gets clicked. This is true for basic buttons, but also for radio buttons, check buttons, etc. I would have assumed that you were already reacting to these messages anyways. But anyways, so, it's not exactly that you're iterating through all of the options constantly, but you'd just watch for when they change, e.g. @option1 = FXCheckButton.new(...) @option1.connect(SEL_COMMAND) do # the user clicked this check button to turn the option "on" or "off"... @config_changed = true end >> >> That sounds like a good job for the registry (FXRegistry) service. > > Interesting.? I found some info at http://www.fox-toolkit.com/registry.html > but no examples that I can learn from.? Do you know of any examples?? I like > using the button.rb script for testing with.? If I can figure out how to > load/save the settings for that program, I should be able to transfer it to > my app. Sure, take a look at the imageviewer.rb example program that comes with FXRuby. In the ImageWindow#onCmdQuit method you see examples of how to write application settings out to the registry; in ImageWindow#create, you see the opposite (reading those saved settings back into the application). From s.cambour at gmail.com Tue Mar 23 10:01:05 2010 From: s.cambour at gmail.com (=?UTF-8?Q?Sergue=C3=AF_Cambour?=) Date: Tue, 23 Mar 2010 15:01:05 +0100 Subject: [fxruby-users] how to use FXCalendar widget Message-ID: Hi everyone ! Can anybody explaine me in some lines how to use FXCalendar component,please. I tried as follows: [code] require 'rubygems' require 'fox16' include Fox class Main < FXMainWindow def initialize(app) super(app, "AGC - Excel file processing" , :width => 600, :height => 400) add_calendar end def add_calendar FXCalendar.new(self) end def create super show(PLACEMENT_SCREEN) end if __FILE__ == $0 FXApp.new do |app| Main.new(app) app.create app.run end end end [/code] and got the beloow exception: [code] C:/Documents and Settings/cambose/My Documents/projects/excel_gui/lib/main.rb:14:in `add_calendar': uninitialized constant Main::FXCalendar (NameError) from C:/Documents and Settings/cambose/My Documents/projects/excel_gui/lib/main.rb:9:in `initialize' from C:/Documents and Settings/cambose/My Documents/projects/excel_gui/lib/main.rb:24:in `new' from C:/Documents and Settings/cambose/My Documents/projects/excel_gui/lib/main.rb:24 from C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in `old_initialize' from C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in `initialize' from C:/Documents and Settings/cambose/My Documents/projects/excel_gui/lib/main.rb:23:in `new' from C:/Documents and Settings/cambose/My Documents/projects/excel_gui/lib/main.rb:23 [/code] Any idea how to do that ? Thanks -- Sergue? CAMBOUR +32-499-36.17.73 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jkinsella at ancillaryservices.com Tue Mar 23 10:11:49 2010 From: jkinsella at ancillaryservices.com (Joey Kinsella) Date: Tue, 23 Mar 2010 10:11:49 -0400 Subject: [fxruby-users] how to use FXCalendar widget In-Reply-To: References: Message-ID: <39b4b9791003230711u6eb5e08cse87626d67bc7da30@mail.gmail.com> The code you posted worked fine for me as soon as I added: require 'fox16/calendar' I am not sure why require 'fox16' isn't including the FXCalendar object. Perhaps a bug? I hope this helps you, --Joey On Tue, Mar 23, 2010 at 10:01 AM, Sergue? Cambour wrote: > Hi everyone ! Can anybody explaine me in some lines how to use FXCalendar > component,please. > I tried as follows: > > [code] > require 'rubygems' > require 'fox16' > include Fox > > class Main < FXMainWindow > > def initialize(app) > super(app, "AGC - Excel file processing" , :width => 600, :height => > 400) > add_calendar > > end > > def add_calendar > FXCalendar.new(self) > end > > def create > super > show(PLACEMENT_SCREEN) > end > > if __FILE__ == $0 > FXApp.new do |app| > Main.new(app) > app.create > app.run > end > end > end > > [/code] > > and got the beloow exception: > [code] > C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:14:in `add_calendar': uninitialized > constant Main::FXCalendar (NameError) > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:9:in `initialize' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:24:in `new' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:24 > from > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > `old_initialize' > from > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > `initialize' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:23:in `new' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:23 > [/code] > > Any idea how to do that ? Thanks > > -- > Sergue? CAMBOUR > +32-499-36.17.73 > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tester.paul at gmail.com Tue Mar 23 10:12:24 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 23 Mar 2010 10:12:24 -0400 Subject: [fxruby-users] How do you enable a button for any option change in UI? In-Reply-To: <57cf8f721003230646ja2a7b7l179d34214b9b6ae3@mail.gmail.com> References: <37c405481003221158g53cca526nf96011b42a42aa22@mail.gmail.com> <57cf8f721003221310k31ff908q168c21033bd6d18c@mail.gmail.com> <37c405481003222111v328bcaa8nb7b35c0dab3dcee@mail.gmail.com> <57cf8f721003230646ja2a7b7l179d34214b9b6ae3@mail.gmail.com> Message-ID: <37c405481003230712j1a2f7bcbrded3e543b946f021@mail.gmail.com> > > Almost every widget that can be "clicked" sends a SEL_COMMAND message > to its target whenever it gets clicked. This is true for basic > buttons, but also for radio buttons, check buttons, etc. I would have > assumed that you were already reacting to these messages anyways. But > anyways, so, it's not exactly that you're iterating through all of the > options constantly, but you'd just watch for when they change, e.g. > > @option1 = FXCheckButton.new(...) > @option1.connect(SEL_COMMAND) do > # the user clicked this check button to turn the option "on" or > "off"... > @config_changed = true > end > Ah, yes. I hadn't gotten that far yet. I'm still working with the UI to see if I can get it to do everything I need before I add the guts of the functions. Thanks for the tip here. > > >> > >> That sounds like a good job for the registry (FXRegistry) service. > > Sure, take a look at the imageviewer.rb example program that comes > with FXRuby. In the ImageWindow#onCmdQuit method you see examples of > how to write application settings out to the registry; in > ImageWindow#create, you see the opposite (reading those saved settings > back into the application). > That's perfect. Thanks. I am now debating whether it's worth the bother of having a separate [Save Config] button or if I should just automatically save the options every time on exit like that example. BTW, do you know where these registry options are saved on a Windows box? I searched for a .foxrc file and in the registry but I couldn't find them. I'd like to have an idea of what the saved options look like to help me figure out how to save/load them. Thanks! Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tester.paul at gmail.com Tue Mar 23 10:19:18 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 23 Mar 2010 10:19:18 -0400 Subject: [fxruby-users] foxGUIb - how do you insert a title bar icon? In-Reply-To: <43d756721003230244y37c5b039xe55a870f129b600f@mail.gmail.com> References: <37c405481003222036r21d9691bm9894b83e782c75c8@mail.gmail.com> <43d756721003230244y37c5b039xe55a870f129b600f@mail.gmail.com> Message-ID: <37c405481003230719i1787f84age7338ca9cab9ed80@mail.gmail.com> On 23 March 2010 05:44, Meinrad Recheis wrote: > Hi Paul, > Just, do it as you would do it with FXRuby using the instance of the FXRuby > mainwindow. IIRC a variable called @topwin is generated by foxguib where you > can access it. > -- henon > umm, I'm afraid I don't understand this advice. I tried modifying the construct_widget_tree method to include a "w.icon" property for the mainwindow, but it didn't work. (I guessed, oh well.) I tried adding "setIcon()" in the initialize and init methods but just got different errors. Can you give an example in a line or two of how you can do this? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Tue Mar 23 11:08:41 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 23 Mar 2010 10:08:41 -0500 Subject: [fxruby-users] How do you enable a button for any option change in UI? In-Reply-To: <37c405481003230712j1a2f7bcbrded3e543b946f021@mail.gmail.com> References: <37c405481003221158g53cca526nf96011b42a42aa22@mail.gmail.com> <57cf8f721003221310k31ff908q168c21033bd6d18c@mail.gmail.com> <37c405481003222111v328bcaa8nb7b35c0dab3dcee@mail.gmail.com> <57cf8f721003230646ja2a7b7l179d34214b9b6ae3@mail.gmail.com> <37c405481003230712j1a2f7bcbrded3e543b946f021@mail.gmail.com> Message-ID: <57cf8f721003230808l5a9c81e6q514188d65151af5d@mail.gmail.com> On Tue, Mar 23, 2010 at 9:12 AM, Paul Carvalho wrote: > I am now debating whether it's worth the bother of having a separate [Save > Config] button or if I should just automatically save the options every time > on exit like that example. Personally, I think the latter option is preferable. > BTW, do you know where these registry options are saved on a Windows box? On Windows, they're saved in the Windows registry itself (not to a file). I know that it uses the application's app name and vendor name as parts of the registry key, but I think you'll need to dig into the FXRegistry class source code to get the specifics. From s.cambour at gmail.com Tue Mar 23 11:18:53 2010 From: s.cambour at gmail.com (=?UTF-8?Q?Sergue=C3=AF_Cambour?=) Date: Tue, 23 Mar 2010 16:18:53 +0100 Subject: [fxruby-users] fxruby-users Digest, Vol 66, Issue 12 (adding FXCalendare component) Message-ID: Yeas, thanks a lot, it works after adding the below line, as you sugested: require 'fox16/calendar' 2010/3/23 > Send fxruby-users mailing list submissions to > fxruby-users at rubyforge.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://rubyforge.org/mailman/listinfo/fxruby-users > or, via email, send a message with subject or body 'help' to > fxruby-users-request at rubyforge.org > > You can reach the person managing the list at > fxruby-users-owner at rubyforge.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fxruby-users digest..." > > > Today's Topics: > > 1. Re: How do you enable a button for any option change in UI? > (Lyle Johnson) > 2. how to use FXCalendar widget (Sergue? Cambour) > 3. Re: how to use FXCalendar widget (Joey Kinsella) > 4. Re: How do you enable a button for any option change in UI? > (Paul Carvalho) > 5. Re: foxGUIb - how do you insert a title bar icon? (Paul Carvalho) > 6. Re: How do you enable a button for any option change in UI? > (Lyle Johnson) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 23 Mar 2010 08:46:10 -0500 > From: Lyle Johnson > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] How do you enable a button for any option > change in UI? > Message-ID: > <57cf8f721003230646ja2a7b7l179d34214b9b6ae3 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On Mon, Mar 22, 2010 at 11:11 PM, Paul Carvalho > wrote: > > > On 22 March 2010 16:10, Lyle Johnson wrote: > >> > >> Elsewhere in my code, I'd set @config_changed to false whenever the > >> user clicked "Save Config", or to false whenever they made a change to > >> one of the config values. > > > > This is the part that I wanted help with.? How does the app know if/when > > _any_ option has changed?? Do I need to iterate through every option and > > check for status change?? Is there a method that tells me when an object > has > > changed from when it was first drawn/created? > > Almost every widget that can be "clicked" sends a SEL_COMMAND message > to its target whenever it gets clicked. This is true for basic > buttons, but also for radio buttons, check buttons, etc. I would have > assumed that you were already reacting to these messages anyways. But > anyways, so, it's not exactly that you're iterating through all of the > options constantly, but you'd just watch for when they change, e.g. > > @option1 = FXCheckButton.new(...) > @option1.connect(SEL_COMMAND) do > # the user clicked this check button to turn the option "on" or > "off"... > @config_changed = true > end > > >> > >> That sounds like a good job for the registry (FXRegistry) service. > > > > Interesting.? I found some info at > http://www.fox-toolkit.com/registry.html > > but no examples that I can learn from.? Do you know of any examples?? I > like > > using the button.rb script for testing with.? If I can figure out how to > > load/save the settings for that program, I should be able to transfer it > to > > my app. > > Sure, take a look at the imageviewer.rb example program that comes > with FXRuby. In the ImageWindow#onCmdQuit method you see examples of > how to write application settings out to the registry; in > ImageWindow#create, you see the opposite (reading those saved settings > back into the application). > > > ------------------------------ > > Message: 2 > Date: Tue, 23 Mar 2010 15:01:05 +0100 > From: Sergue? Cambour > To: fxruby-users at rubyforge.org > Subject: [fxruby-users] how to use FXCalendar widget > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi everyone ! Can anybody explaine me in some lines how to use FXCalendar > component,please. > I tried as follows: > > [code] > require 'rubygems' > require 'fox16' > include Fox > > class Main < FXMainWindow > > def initialize(app) > super(app, "AGC - Excel file processing" , :width => 600, :height => > 400) > add_calendar > > end > > def add_calendar > FXCalendar.new(self) > end > > def create > super > show(PLACEMENT_SCREEN) > end > > if __FILE__ == $0 > FXApp.new do |app| > Main.new(app) > app.create > app.run > end > end > end > > [/code] > > and got the beloow exception: > [code] > C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:14:in `add_calendar': > uninitialized > constant Main::FXCalendar (NameError) > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:9:in `initialize' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:24:in `new' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:24 > from > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > `old_initialize' > from > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > `initialize' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:23:in `new' > from C:/Documents and Settings/cambose/My > Documents/projects/excel_gui/lib/main.rb:23 > [/code] > > Any idea how to do that ? Thanks > > -- > Sergue? CAMBOUR > +32-499-36.17.73 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/b63ddf01/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Tue, 23 Mar 2010 10:11:49 -0400 > From: Joey Kinsella > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] how to use FXCalendar widget > Message-ID: > <39b4b9791003230711u6eb5e08cse87626d67bc7da30 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > The code you posted worked fine for me as soon as I added: > > require 'fox16/calendar' > > I am not sure why require 'fox16' isn't including the FXCalendar object. > Perhaps a bug? > > I hope this helps you, > --Joey > > On Tue, Mar 23, 2010 at 10:01 AM, Sergue? Cambour >wrote: > > > Hi everyone ! Can anybody explaine me in some lines how to use FXCalendar > > component,please. > > I tried as follows: > > > > [code] > > require 'rubygems' > > require 'fox16' > > include Fox > > > > class Main < FXMainWindow > > > > def initialize(app) > > super(app, "AGC - Excel file processing" , :width => 600, :height => > > 400) > > add_calendar > > > > end > > > > def add_calendar > > FXCalendar.new(self) > > end > > > > def create > > super > > show(PLACEMENT_SCREEN) > > end > > > > if __FILE__ == $0 > > FXApp.new do |app| > > Main.new(app) > > app.create > > app.run > > end > > end > > end > > > > [/code] > > > > and got the beloow exception: > > [code] > > C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:14:in `add_calendar': > uninitialized > > constant Main::FXCalendar (NameError) > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:9:in `initialize' > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:24:in `new' > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:24 > > from > > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > > `old_initialize' > > from > > > C:/Ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/kwargs.rb:267:in > > `initialize' > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:23:in `new' > > from C:/Documents and Settings/cambose/My > > Documents/projects/excel_gui/lib/main.rb:23 > > [/code] > > > > Any idea how to do that ? Thanks > > > > -- > > Sergue? CAMBOUR > > +32-499-36.17.73 > > > > _______________________________________________ > > fxruby-users mailing list > > fxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/fxruby-users > > > > -- > If you are not the intended recipient, you are hereby notified > that any dissemination, distribution, copying or other use of > this communication is strictly prohibited. If you have > received this communication in error, please notify us > immediately. > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/575da872/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Tue, 23 Mar 2010 10:12:24 -0400 > From: Paul Carvalho > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] How do you enable a button for any option > change in UI? > Message-ID: > <37c405481003230712j1a2f7bcbrded3e543b946f021 at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > > > > Almost every widget that can be "clicked" sends a SEL_COMMAND message > > to its target whenever it gets clicked. This is true for basic > > buttons, but also for radio buttons, check buttons, etc. I would have > > assumed that you were already reacting to these messages anyways. But > > anyways, so, it's not exactly that you're iterating through all of the > > options constantly, but you'd just watch for when they change, e.g. > > > > @option1 = FXCheckButton.new(...) > > @option1.connect(SEL_COMMAND) do > > # the user clicked this check button to turn the option "on" or > > "off"... > > @config_changed = true > > end > > > > Ah, yes. I hadn't gotten that far yet. I'm still working with the UI to > see if I can get it to do everything I need before I add the guts of the > functions. Thanks for the tip here. > > > > > > > >> > > >> That sounds like a good job for the registry (FXRegistry) service. > > > > Sure, take a look at the imageviewer.rb example program that comes > > with FXRuby. In the ImageWindow#onCmdQuit method you see examples of > > how to write application settings out to the registry; in > > ImageWindow#create, you see the opposite (reading those saved settings > > back into the application). > > > > That's perfect. Thanks. > > I am now debating whether it's worth the bother of having a separate [Save > Config] button or if I should just automatically save the options every > time > on exit like that example. > > BTW, do you know where these registry options are saved on a Windows box? > I > searched for a .foxrc file and in the registry but I couldn't find them. > I'd like to have an idea of what the saved options look like to help me > figure out how to save/load them. > > Thanks! Paul. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/4969a0ca/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Tue, 23 Mar 2010 10:19:18 -0400 > From: Paul Carvalho > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] foxGUIb - how do you insert a title bar > icon? > Message-ID: > <37c405481003230719i1787f84age7338ca9cab9ed80 at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > On 23 March 2010 05:44, Meinrad Recheis wrote: > > > Hi Paul, > > Just, do it as you would do it with FXRuby using the instance of the > FXRuby > > mainwindow. IIRC a variable called @topwin is generated by foxguib where > you > > can access it. > > -- henon > > > > umm, I'm afraid I don't understand this advice. > > I tried modifying the construct_widget_tree method to include a "w.icon" > property for the mainwindow, but it didn't work. (I guessed, oh well.) I > tried adding "setIcon()" in the initialize and init methods but just got > different errors. > > Can you give an example in a line or two of how you can do this? > > Thanks. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://rubyforge.org/pipermail/fxruby-users/attachments/20100323/d1f4ea7e/attachment-0001.html > > > > ------------------------------ > > Message: 6 > Date: Tue, 23 Mar 2010 10:08:41 -0500 > From: Lyle Johnson > To: fxruby-users at rubyforge.org > Subject: Re: [fxruby-users] How do you enable a button for any option > change in UI? > Message-ID: > <57cf8f721003230808l5a9c81e6q514188d65151af5d at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On Tue, Mar 23, 2010 at 9:12 AM, Paul Carvalho > wrote: > > > I am now debating whether it's worth the bother of having a separate > [Save > > Config] button or if I should just automatically save the options every > time > > on exit like that example. > > Personally, I think the latter option is preferable. > > > BTW, do you know where these registry options are saved on a Windows box? > > On Windows, they're saved in the Windows registry itself (not to a > file). I know that it uses the application's app name and vendor name > as parts of the registry key, but I think you'll need to dig into the > FXRegistry class source code to get the specifics. > > > ------------------------------ > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > > End of fxruby-users Digest, Vol 66, Issue 12 > ******************************************** > -- Sergue? CAMBOUR +32-499-36.17.73 -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Tue Mar 23 11:27:18 2010 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Tue, 23 Mar 2010 16:27:18 +0100 Subject: [fxruby-users] foxGUIb - how do you insert a title bar icon? In-Reply-To: <37c405481003230719i1787f84age7338ca9cab9ed80@mail.gmail.com> References: <37c405481003222036r21d9691bm9894b83e782c75c8@mail.gmail.com> <43d756721003230244y37c5b039xe55a870f129b600f@mail.gmail.com> <37c405481003230719i1787f84age7338ca9cab9ed80@mail.gmail.com> Message-ID: <43d756721003230827nd32cfa5r5df0eda5dde84f93@mail.gmail.com> Ah, I see, you expect foxguib to generate the right code for you ;) ... I am afraid that isn't so easy, and I have forgotten about foxguib's internals totally. I was talking about setting the icon later in your hand coded extensions to the generated code. hth, -- henon On Tue, Mar 23, 2010 at 3:19 PM, Paul Carvalho wrote: > On 23 March 2010 05:44, Meinrad Recheis wrote: > >> Hi Paul, >> Just, do it as you would do it with FXRuby using the instance of the >> FXRuby mainwindow. IIRC a variable called @topwin is generated by foxguib >> where you can access it. >> -- henon >> > > umm, I'm afraid I don't understand this advice. > > I tried modifying the construct_widget_tree method to include a "w.icon" > property for the mainwindow, but it didn't work. (I guessed, oh well.) I > tried adding "setIcon()" in the initialize and init methods but just got > different errors. > > Can you give an example in a line or two of how you can do this? > > Thanks. > > > _______________________________________________ > 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 meinrad.recheis at gmail.com Tue Mar 23 11:33:28 2010 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Tue, 23 Mar 2010 16:33:28 +0100 Subject: [fxruby-users] foxGUIb - how do you insert a title bar icon? In-Reply-To: <43d756721003230827nd32cfa5r5df0eda5dde84f93@mail.gmail.com> References: <37c405481003222036r21d9691bm9894b83e782c75c8@mail.gmail.com> <43d756721003230244y37c5b039xe55a870f129b600f@mail.gmail.com> <37c405481003230719i1787f84age7338ca9cab9ed80@mail.gmail.com> <43d756721003230827nd32cfa5r5df0eda5dde84f93@mail.gmail.com> Message-ID: <43d756721003230833w1fb93176k671d764790039301@mail.gmail.com> Wait, maybe I got you wrong. Mind this: foxguib is generating FXRuby code so why should you not be able to set the icon as you said you know how to do it using plain FXRuby. Maybe this is a problem about calling the icon's "create" method at the wrong time or not at all? I am afraid without detailed error messages I can not help out here. -- henon On Tue, Mar 23, 2010 at 4:27 PM, Meinrad Recheis wrote: > Ah, I see, you expect foxguib to generate the right code for you ;) ... I > am afraid that isn't so easy, and I have forgotten about foxguib's internals > totally. > > I was talking about setting the icon later in your hand coded extensions to > the generated code. > > hth, > -- henon > > On Tue, Mar 23, 2010 at 3:19 PM, Paul Carvalho wrote: > >> On 23 March 2010 05:44, Meinrad Recheis wrote: >> >>> Hi Paul, >>> Just, do it as you would do it with FXRuby using the instance of the >>> FXRuby mainwindow. IIRC a variable called @topwin is generated by foxguib >>> where you can access it. >>> -- henon >>> >> >> umm, I'm afraid I don't understand this advice. >> >> I tried modifying the construct_widget_tree method to include a "w.icon" >> property for the mainwindow, but it didn't work. (I guessed, oh well.) I >> tried adding "setIcon()" in the initialize and init methods but just got >> different errors. >> >> Can you give an example in a line or two of how you can do this? >> >> Thanks. >> >> >> _______________________________________________ >> 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 tester.paul at gmail.com Tue Mar 23 12:01:42 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 23 Mar 2010 12:01:42 -0400 Subject: [fxruby-users] foxGUIb - how do you insert a title bar icon? In-Reply-To: <43d756721003230833w1fb93176k671d764790039301@mail.gmail.com> References: <37c405481003222036r21d9691bm9894b83e782c75c8@mail.gmail.com> <43d756721003230244y37c5b039xe55a870f129b600f@mail.gmail.com> <37c405481003230719i1787f84age7338ca9cab9ed80@mail.gmail.com> <43d756721003230827nd32cfa5r5df0eda5dde84f93@mail.gmail.com> <43d756721003230833w1fb93176k671d764790039301@mail.gmail.com> Message-ID: <37c405481003230901y24e67325va60da8964a706d84@mail.gmail.com> On 23 March 2010 11:33, Meinrad Recheis wrote: > Wait, maybe I got you wrong. > Mind this: foxguib is generating FXRuby code so why should you not be able > to set the icon as you said you know how to do it using plain FXRuby. Maybe > this is a problem about calling the icon's "create" method at the wrong time > or not at all? > > I am afraid without detailed error messages I can not help out here. > > -- henon > > Since I don't know where & how to set the icon with the FoxGUIb code, I don't know which error messages you would be interested in. All you have to do is generate a quick window and try to set the image. Here's a sample window. How would you display an icon in the title bar? # source generated by foxGUIb 1.0.0 class MainWindow def initialize( parent) construct_widget_tree( parent) init if respond_to? 'init' end def construct_widget_tree( parent) @topwin= FX::MainWindow.new(parent){|w| @mainWindow=w w.wdg_name='mainWindow' w.width=336 w.shown=true w.y=265 w.height=183 w.title="show title bar image" w.x=47 } end attr_reader :topwin attr_reader :mainWindow end #unit test if __FILE__==$0 require 'libGUIb16' app=FX::App.new w=MainWindow.new app w.topwin.show(Fox::PLACEMENT_SCREEN) app.create app.run end -------------- next part -------------- An HTML attachment was scrubbed... URL: From meinrad.recheis at gmail.com Tue Mar 23 16:52:24 2010 From: meinrad.recheis at gmail.com (Meinrad Recheis) Date: Tue, 23 Mar 2010 21:52:24 +0100 Subject: [fxruby-users] foxGUIb - how do you insert a title bar icon? In-Reply-To: <37c405481003230901y24e67325va60da8964a706d84@mail.gmail.com> References: <37c405481003222036r21d9691bm9894b83e782c75c8@mail.gmail.com> <43d756721003230244y37c5b039xe55a870f129b600f@mail.gmail.com> <37c405481003230719i1787f84age7338ca9cab9ed80@mail.gmail.com> <43d756721003230827nd32cfa5r5df0eda5dde84f93@mail.gmail.com> <43d756721003230833w1fb93176k671d764790039301@mail.gmail.com> <37c405481003230901y24e67325va60da8964a706d84@mail.gmail.com> Message-ID: <43d756721003231352w653febd0y2679170dc7ef17a@mail.gmail.com> hi, I just looked up the code in an old project of mine. this is the code I used to configure the main window icons: @topwin.icon = loadImage "appicon32.png" @topwin.miniIcon = loadImage "appicon.png" loadImage is defined in libguib16 afaik. -- henon On Tue, Mar 23, 2010 at 5:01 PM, Paul Carvalho wrote: > On 23 March 2010 11:33, Meinrad Recheis wrote: > >> Wait, maybe I got you wrong. >> Mind this: foxguib is generating FXRuby code so why should you not be able >> to set the icon as you said you know how to do it using plain FXRuby. Maybe >> this is a problem about calling the icon's "create" method at the wrong time >> or not at all? >> >> I am afraid without detailed error messages I can not help out here. >> >> -- henon >> >> > Since I don't know where & how to set the icon with the FoxGUIb code, I > don't know which error messages you would be interested in. All you have to > do is generate a quick window and try to set the image. > > Here's a sample window. How would you display an icon in the title bar? > > # source generated by foxGUIb 1.0.0 > > class MainWindow > def initialize( parent) > construct_widget_tree( parent) > init if respond_to? 'init' > end > > def construct_widget_tree( parent) > @topwin= > FX::MainWindow.new(parent){|w| > @mainWindow=w > w.wdg_name='mainWindow' > w.width=336 > w.shown=true > w.y=265 > w.height=183 > w.title="show title bar image" > w.x=47 > } > end > attr_reader :topwin > attr_reader :mainWindow > end > > #unit test > if __FILE__==$0 > require 'libGUIb16' > app=FX::App.new > w=MainWindow.new app > w.topwin.show(Fox::PLACEMENT_SCREEN) > app.create > app.run > end > > > > > _______________________________________________ > 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 tester.paul at gmail.com Tue Mar 23 17:15:45 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 23 Mar 2010 17:15:45 -0400 Subject: [fxruby-users] foxGUIb - how do you insert a title bar icon? In-Reply-To: <43d756721003231352w653febd0y2679170dc7ef17a@mail.gmail.com> References: <37c405481003222036r21d9691bm9894b83e782c75c8@mail.gmail.com> <43d756721003230244y37c5b039xe55a870f129b600f@mail.gmail.com> <37c405481003230719i1787f84age7338ca9cab9ed80@mail.gmail.com> <43d756721003230827nd32cfa5r5df0eda5dde84f93@mail.gmail.com> <43d756721003230833w1fb93176k671d764790039301@mail.gmail.com> <37c405481003230901y24e67325va60da8964a706d84@mail.gmail.com> <43d756721003231352w653febd0y2679170dc7ef17a@mail.gmail.com> Message-ID: <37c405481003231415q63d7069cu22acf55b11d547d5@mail.gmail.com> That's awesome! Totally helps. Thanks! I love how you can associate a large and small icon with the app at the same time. Didn't know that. Cool! Cheers! Paul. On 23 March 2010 16:52, Meinrad Recheis wrote: > hi, > I just looked up the code in an old project of mine. this is the code I > used to configure the main window icons: > > @topwin.icon = loadImage "appicon32.png" > @topwin.miniIcon = loadImage "appicon.png" > > loadImage is defined in libguib16 afaik. > > -- henon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tester.paul at gmail.com Tue Mar 23 23:18:00 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 23 Mar 2010 23:18:00 -0400 Subject: [fxruby-users] foxGUIb - Matrix doesn't display elements on same row Message-ID: <37c405481003232018o38f1da05i2708c3a8cb3f7489@mail.gmail.com> I am having some trouble trying to display a 2x2 Matrix correctly that was created in FoxGUIb. Here's what I did: - in foxGUIb, I created: mainWindow > matrix1 (2 columns, 2 rows) > added 4 objects (button1, label1, button2, label2) - I want it to look something like this: ----- [ button1 ] [ label 1 ] [ button2 ] [ label 2 ] ----- (where the label fields fill up the remaining column space on the right) - I modified both label field properties (i.e. in the same column on the right) to include LAYOUT_FILL_COLUMN (and ..FILL_ROW, and ..FILL_X) => it looks correct in foxGUIb. - I saved it and generated the Ruby code, but when I run it, it looks like this: ----- [ button1 ] [ label 1 ] [ button2 ] [ label 2 ] ----- (which is not what I want) I've tried playing around with the layoutHints settings for each object in the matrix but I just can't seem to get it to display in a 2x2 layout when I run the Ruby code. It keeps showing up as a 1x4 matrix. Any suggestions? I've attached the auto-generated code below for a sample app that shows this problem. Paul. # -- Start -- # source generated by foxGUIb 1.0.0 class MainWindow def initialize( parent) construct_widget_tree( parent) init if respond_to? 'init' end def construct_widget_tree( parent) @topwin= FX::MainWindow.new(parent){|w| @mainWindow=w w.wdg_name='mainWindow' w.width=399 w.shown=true w.y=456 w.height=147 w.title="Matrix test" w.x=17 FX::Matrix.new(@mainWindow){|w| @matrix1=w w.wdg_name='matrix1' w.numRows=2 w.frameStyle=12288 w.width=399 w.height=147 w.matrixStyle=131072 w.numColumns=2 FX::Button.new(@matrix1){|w| @button1=w w.wdg_name='button1' w.text="Button 1" w.width=100 w.y=5 w.height=21 w.layoutHints=256 w.x=5 } FX::Label.new(@matrix1){|w| @label1=w w.wdg_name='label1' w.text="Label 1" w.frameStyle=12288 w.width=285 w.y=5 w.height=19 w.layoutHints=1027 w.x=109 w.justify=32768 } FX::Button.new(@matrix1){|w| @button2=w w.wdg_name='button2' w.text="Button 2" w.width=100 w.y=30 w.height=21 w.layoutHints=256 w.x=5 } FX::Label.new(@matrix1){|w| @label2=w w.wdg_name='label2' w.text="Label 2" w.frameStyle=12288 w.width=285 w.y=30 w.height=19 w.layoutHints=1027 w.x=109 w.justify=32768 } } } end attr_reader :topwin attr_reader :mainWindow attr_reader :matrix1 attr_reader :button1 attr_reader :label1 attr_reader :button2 attr_reader :label2 end #unit test if __FILE__==$0 require 'libGUIb16' app=FX::App.new w=MainWindow.new app w.topwin.show(Fox::PLACEMENT_SCREEN) app.create app.run end # -- End -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From dglnz at yahoo.com Wed Mar 24 04:49:30 2010 From: dglnz at yahoo.com (dave L) Date: Wed, 24 Mar 2010 01:49:30 -0700 (PDT) Subject: [fxruby-users] Quitting Extended app via button produces errors In-Reply-To: <37c405481003221512n3ce53c5av110032e6a008f5cf@mail.gmail.com> References: <37c405481003221512n3ce53c5av110032e6a008f5cf@mail.gmail.com> Message-ID: <737832.5705.qm@web30001.mail.mud.yahoo.com> Paul, Just loaded this into my Linux box (hope this works for your winXP - should i think) I got caught and still do sometimes event now but have learn to look for my errors. I suspect if you where to simply change these 2 lines (hope the highlights come through to something like I have then you should be running. require "events_ui" <<<<<< changed the filename of the GUIb code ergo this is changed here!!! class AmainWindow < MainWindow <<<<<< see the changes made here??? def init button1.connect(Fox::SEL_COMMAND){ FXApp::ID_QUIT } end # of events end if __FILE__==$0 require 'libGUIb16' app=FX::App.new w=AmainWindow.new app <<<< see changes made here w.topwin.show(Fox::PLACEMENT_SCREEN) app.create app.run end HTH Dave. ________________________________ From: Paul Carvalho To: fxruby-users at rubyforge.org Sent: Tue, 23 March, 2010 11:12:22 AM Subject: [fxruby-users] Quitting Extended app via button produces errors Hi there, I used foxGUIb to create a UI and a separate file to hold the event actions. When I try to quit the app (see source code below) using a [Quit] button, I get the following error: ----- >rubyw extended_quit.rb extended_quit.rb:5:in `init': uninitialized constant MainWindow::FXApp (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.12-mswin32/lib/fox16/responder2.rb:55:in `call' from c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.12-mswin32/lib/fox16/responder2.rb:55:in `onHandleMsg' from extended_quit.rb:15:in `run' from extended_quit.rb:15 >Exit code: 1 ----- => Question: How do I get the app to quit/exit without showing this error? When I work with a straight FXRuby app (e.g. hello.rb), the app exits without any error. I have tried several ways to try to get the app to quit, and while the error message may change, I can't get the error message to go away and just exit cleanly (0). Please let me know. Thanks. Paul. Here is the code: (1) extended_quit.rb: ----- require "quit_ui" class MainWindow def init button1.connect(Fox::SEL_COMMAND){ FXApp::ID_QUIT } end # of events end if __FILE__==$0 require 'libGUIb16' app=FX::App.new w=MainWindow.new app w.topwin.show(Fox::PLACEMENT_SCREEN) app.create app.run end ----- (2) quit_ui.rb: ----- # source generated by foxGUIb 1.0.0 class MainWindow def initialize( parent) construct_widget_tree( parent) init if respond_to? 'init' end def construct_widget_tree( parent) @topwin= FX::MainWindow.new(parent){|w| @mainWindow=w w.wdg_name='mainWindow' w.width=300 w.shown=true w.y=233 w.height=100 w.x=55 FX::Button.new(@mainWindow){|w| @button1=w w.wdg_name='button1' w.text="Quit" w.width=50 w.height=30 } } end attr_reader :topwin attr_reader :mainWindow attr_reader :button1 end ----- -------------- next part -------------- An HTML attachment was scrubbed... URL: From paguilera at yahoo.com Thu Mar 25 15:51:52 2010 From: paguilera at yahoo.com (Patricio Aguilera) Date: Thu, 25 Mar 2010 12:51:52 -0700 (PDT) Subject: [fxruby-users] Fw: Error Updating fxruby gem Message-ID: <111279.26233.qm@web52605.mail.re2.yahoo.com> Hello folks, I didn't see this one show up on the mailing list so I'm sending it again. -Thank you- Patricio --- On Wed, 3/24/10, Patricio Aguilera wrote: > From: Patricio Aguilera > Subject: Error Updating fxruby gem > To: fxruby-users at rubyforge.org > Date: Wednesday, March 24, 2010, 10:54 AM > Hello, > > I'm trying to run the gem update command to update my local > gems.? When it gets to the fxruby gem, I get the > following error (note: I copied the text from the command > window): > > Updating fxruby > Building native extensions.? This could take a > while... > ERROR:? Error installing fxruby: > ? ? ? ? ERROR: Failed to build gem > native extension. > > c:/ruby/bin/ruby.exe extconf.rb > *** extconf.rb failed *** > Could not create Makefile due to some reason, probably lack > of > necessary libraries and/or headers.? Check the > mkmf.log file for more > details.? You may need configuration options. > > Provided configuration options: > ? ? ? ? --with-opt-dir > ? ? ? ? --without-opt-dir > ? ? ? ? --with-opt-include > ? ? ? ? > --without-opt-include=${opt-dir}/include > ? ? ? ? --with-opt-lib > ? ? ? ? > --without-opt-lib=${opt-dir}/lib > ? ? ? ? --with-make-prog > ? ? ? ? --srcdir=. > ? ? ? ? --curdir > ? ? ? ? --ruby=c:/ruby/bin/ruby > ? ? ? ? --with-fox-dir > ? ? ? ? --without-fox-dir > ? ? ? ? --with-fox-include > ? ? ? ? > --without-fox-include=${fox-dir}/include > ? ? ? ? --with-fox-lib > ? ? ? ? > --without-fox-lib=${fox-dir}/lib > ? ? ? ? --with-fxscintilla-dir > ? ? ? ? --without-fxscintilla-dir > ? ? ? ? --with-fxscintilla-include > ? ? ? ? > --without-fxscintilla-include=${fxscintilla-dir}/include > ? ? ? ? --with-fxscintilla-lib > ? ? ? ? > --without-fxscintilla-lib=${fxscintilla-dir}/lib > extconf.rb:31:in `find_installed_fox_version': couldn't > find FOX header files (R > untimeError) > ? ? ? ? from extconf.rb:125 > > > Gem files will remain installed in > c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.20 > for inspection. > Results logged to > c:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.20/ext/fox16/gem_mak > e.out > > > > I've also attached the gem_make.out file. > > -Thank you- > > Patricio > > > ? ? ? -------------- next part -------------- A non-text attachment was scrubbed... Name: gem_make.out Type: application/octet-stream Size: 954 bytes Desc: not available URL: From lyle at lylejohnson.name Thu Mar 25 16:32:55 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 25 Mar 2010 15:32:55 -0500 Subject: [fxruby-users] Fw: Error Updating fxruby gem In-Reply-To: <111279.26233.qm@web52605.mail.re2.yahoo.com> References: <111279.26233.qm@web52605.mail.re2.yahoo.com> Message-ID: <57cf8f721003251332v513abe48i4eee4108d0c7d4fa@mail.gmail.com> On Thu, Mar 25, 2010 at 2:51 PM, Patricio Aguilera wrote: >> Hello, >> >> I'm trying to run the gem update command to update my local >> gems.? When it gets to the fxruby gem, I get the >> following error (note: I copied the text from the command >> window): >> >> Updating fxruby >> Building native extensions.? This could take a >> while... >> ERROR:? Error installing fxruby: >> ? ? ? ? ERROR: Failed to build gem >> native extension. That's odd. It looks like you're running on Windows, so I don't understand why it didn't just select the precompiled binary gem for Windows. Which version of Ruby are you running, and from where did you download it? From paguilera at yahoo.com Thu Mar 25 17:15:34 2010 From: paguilera at yahoo.com (Patricio Aguilera) Date: Thu, 25 Mar 2010 14:15:34 -0700 (PDT) Subject: [fxruby-users] Fw: Error Updating fxruby gem In-Reply-To: <57cf8f721003251332v513abe48i4eee4108d0c7d4fa@mail.gmail.com> Message-ID: <876071.30760.qm@web52603.mail.re2.yahoo.com> --- On Thu, 3/25/10, Lyle Johnson wrote: > From: Lyle Johnson > Patricio Aguilera > wrote: > > >> Hello, > >> > >> I'm trying to run the gem update command to update > my local > >> gems.? When it gets to the fxruby gem, I get the > >> following error (note: I copied the text from the > command > >> window): > >> > >> Updating fxruby > >> Building native extensions.? This could take a > >> while... > >> ERROR:? Error installing fxruby: > >> ? ? ? ? ERROR: Failed to build gem > >> native extension. > > That's odd. It looks like you're running on Windows, so I > don't > understand why it didn't just select the precompiled binary > gem for > Windows. Which version of Ruby are you running, and from > where did you > download it? I am running the following version: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] I pulled it some time ago from ruby-lang.org. I've actually been using ruby on that box for several months now and was able to install the original gem when I installed ruby after picking up the FXRuby book. Other gems have updated correctly on that system, even when I encountered this error. However, that particular box is running Windows XP Pro x64 Edition. -Thank you- Patricio From lyle at lylejohnson.name Fri Mar 26 11:10:43 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Fri, 26 Mar 2010 10:10:43 -0500 Subject: [fxruby-users] Fw: Error Updating fxruby gem In-Reply-To: <876071.30760.qm@web52603.mail.re2.yahoo.com> References: <57cf8f721003251332v513abe48i4eee4108d0c7d4fa@mail.gmail.com> <876071.30760.qm@web52603.mail.re2.yahoo.com> Message-ID: <57cf8f721003260810r49905ad4rf3e51fc20e0827b9@mail.gmail.com> On Thu, Mar 25, 2010 at 4:15 PM, Patricio Aguilera wrote: > I am running the following version: > ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] Hmm. See what happens if you type this instead: gem update fxruby --platform x86-mingw32 As of FXRuby 1.6.20 I started building the Windows gems using the MinGW-based Ruby installer. Even though those are compatible with the "old" Ruby installer for Windows (which is what you're running), the platform is different ("i386-mswin32" versus "i386-mingw32") and that may be why RubyGems doesn't think it's a match... From paguilera at yahoo.com Fri Mar 26 11:46:00 2010 From: paguilera at yahoo.com (Patricio Aguilera) Date: Fri, 26 Mar 2010 08:46:00 -0700 (PDT) Subject: [fxruby-users] Fw: Error Updating fxruby gem In-Reply-To: <57cf8f721003260810r49905ad4rf3e51fc20e0827b9@mail.gmail.com> Message-ID: <612671.44543.qm@web52603.mail.re2.yahoo.com> --- On Fri, 3/26/10, Lyle Johnson wrote: > > I am running the following version: > > ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] > > Hmm. See what happens if you type this instead: > > ? ? gem update fxruby --platform x86-mingw32 > > As of FXRuby 1.6.20 I started building the Windows gems > using the > MinGW-based Ruby installer. Even though those are > compatible with the > "old" Ruby installer for Windows (which is what you're > running), the > platform is different ("i386-mswin32" versus > "i386-mingw32") and that > may be why RubyGems doesn't think it's a match... Hi Lyle, That appears to have done the trick: >gem update fxruby --platform x86-mingw32 Updating installed gems Updating fxruby Successfully installed fxruby-1.6.20-x86-mingw32 Gems updated: fxruby Installing ri documentation for fxruby-1.6.20-x86-mingw32... Installing RDoc documentation for fxruby-1.6.20-x86-mingw32... Thank you for your help. -Thank you- Patricio From tester.paul at gmail.com Tue Mar 30 16:24:12 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 30 Mar 2010 16:24:12 -0400 Subject: [fxruby-users] Is there a way to enforce a minimum (app) window size? Message-ID: <37c405481003301324i2e4562e3t3d28285692413380@mail.gmail.com> I created a simple app and need to allow the DECOR_RESIZE option. Unfortunately, it means that the user can shrink the window size to something smaller than what all the important elements require. Is there a way to enforce a minimum window size? i.e. so that the window can be resized but not smaller than, say 200x200? I googled this but didn't turn up anything for FXRuby. Please let me know if there's a way to do this. Thanks. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Tue Mar 30 16:59:39 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Tue, 30 Mar 2010 15:59:39 -0500 Subject: [fxruby-users] Is there a way to enforce a minimum (app) window size? In-Reply-To: <37c405481003301324i2e4562e3t3d28285692413380@mail.gmail.com> References: <37c405481003301324i2e4562e3t3d28285692413380@mail.gmail.com> Message-ID: <57cf8f721003301359o71d4997aj8c56eb7bcf1999a0@mail.gmail.com> On Tue, Mar 30, 2010 at 3:24 PM, Paul Carvalho wrote: > I created a simple app and need to allow the DECOR_RESIZE option. > ?Unfortunately, it means that the user can shrink the window size to > something smaller than what all the important elements require. > Is there a way to enforce a minimum window size? ?i.e. so that the window > can be resized but not smaller than, say 200x200? > I googled this but didn't turn up anything for FXRuby. ?Please let me know > if there's a way to do this. I have not tried this, but see this question from the FOX FAQ: http://www.fox-toolkit.net/faq#TOC-How-can-I-specify-a-minimum-window- Hope this helps, Lyle From tester.paul at gmail.com Tue Mar 30 17:32:58 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 30 Mar 2010 17:32:58 -0400 Subject: [fxruby-users] Is there a way to enforce a minimum (app) window size? In-Reply-To: <57cf8f721003301359o71d4997aj8c56eb7bcf1999a0@mail.gmail.com> References: <37c405481003301324i2e4562e3t3d28285692413380@mail.gmail.com> <57cf8f721003301359o71d4997aj8c56eb7bcf1999a0@mail.gmail.com> Message-ID: <37c405481003301432s77fe91b8l750764cd1f75e27d@mail.gmail.com> On 30 March 2010 16:59, Lyle Johnson wrote: > > I have not tried this, but see this question from the FOX FAQ: > > http://www.fox-toolkit.net/faq#TOC-How-can-I-specify-a-minimum-window- > > Hope this helps, > > Lyle > Cool FAQ. Thanks, Lyle. I didn't know about that page. DECOR_STRETCHABLE works perfectly (in place of DECOR_RESIZE)! It lets me resize the window but never smaller than the minimum amount of space required by the elements in the window. I also changed the statusbar property to remove STATUSBAR_WITH_DRAGCORNER. Personally, I like that UI style, but it does some funky UI bug thing if you drag the status bar instead of the window edge. I can live without the bug.. especially since I'll likely be passing my app onto other testers. ;) Cheers! Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tester.paul at gmail.com Tue Mar 30 18:17:55 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 30 Mar 2010 18:17:55 -0400 Subject: [fxruby-users] Can you display bullets in labels? Message-ID: <37c405481003301517w7fa44d1cq1bf9bb14ed650ace@mail.gmail.com> I want to display some points in a section of a window using bullets similar to the HTML
  • . Is that possible in FXRuby? I couldn't find any examples to help me do this. I am trying to put these points into a label field - e.g.: bullet_point_1 = FXLabel.new(contents, " o Something important") I tried pasting the actual symbol into the string but it displays a square in the app UI. How can I show symbols? I was also wondering about the copyright (c) symbol. Please let me know. Thanks. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tester.paul at gmail.com Wed Mar 31 01:13:03 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 31 Mar 2010 01:13:03 -0400 Subject: [fxruby-users] Need help getting ALT+F4 hotkey to work Message-ID: Hi there, quick question. I am trying to make my app aware of the ALT+F4 hot-key to quit but can't quite get the syntax correct. My app has a method to handle the close/quit event, and I have the following lines: ---- button_quit.connect(SEL_COMMAND, method( :onCmdQuit )) self.connect(SEL_CLOSE, method( :onCmdQuit )) # self.accelTable.addAccel( fxparseAccel( "Alt+F4" ), self, method( :onCmdQuit ) ) ---- The first 2 lines work as expected and re-route the Quit event from either the 'Quit' button or the [X] close button from the title bar to the shutdown method. (good) The 3rd line doesn't work though. When I run the app, I get the error: "in `addAccel': can't convert Method into Integer (TypeError)" What am I missing? I've tried several variations on that command to get the hot-key to work but I've had no luck yet. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matma.rex at gmail.com Wed Mar 31 07:12:53 2010 From: matma.rex at gmail.com (=?UTF-8?Q?Bartosz_Dziewo=C5=84ski?=) Date: Wed, 31 Mar 2010 14:12:53 +0300 Subject: [fxruby-users] Need help getting ALT+F4 hotkey to work In-Reply-To: References: Message-ID: http://www.fxruby.org/doc/api/classes/Fox/FXAccelTable.html#M000142 You probably (I didn't test it) need to send SEL_CLOSE command to your main window in third line (and then it will be catched by your second line), using technique mentioned under that link. Read docs, they contain lots of info. -- Matma Rex - http://matma-rex.prv.pl/ From matma.rex at gmail.com Wed Mar 31 07:18:31 2010 From: matma.rex at gmail.com (=?UTF-8?Q?Bartosz_Dziewo=C5=84ski?=) Date: Wed, 31 Mar 2010 14:18:31 +0300 Subject: [fxruby-users] Can you display bullets in labels? In-Reply-To: <37c405481003301517w7fa44d1cq1bf9bb14ed650ace@mail.gmail.com> References: <37c405481003301517w7fa44d1cq1bf9bb14ed650ace@mail.gmail.com> Message-ID: If I were you, I'd just add small round icon to the label and place it to the left using layout hints. (http://www.fxruby.org/doc/api/classes/Fox/FXLabel.html) -- Matma Rex - http://matma-rex.prv.pl/ From lyle at lylejohnson.name Wed Mar 31 10:44:27 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 31 Mar 2010 09:44:27 -0500 Subject: [fxruby-users] Can you display bullets in labels? In-Reply-To: <37c405481003301517w7fa44d1cq1bf9bb14ed650ace@mail.gmail.com> References: <37c405481003301517w7fa44d1cq1bf9bb14ed650ace@mail.gmail.com> Message-ID: On Tue, Mar 30, 2010 at 5:17 PM, Paul Carvalho wrote: > I want to display some points in a section of a window using bullets similar > to the HTML
  • . ?Is that possible in FXRuby? ?I couldn't find any examples > to help me do this. > I am trying to put these points into a label field - e.g.: > bullet_point_1 = FXLabel.new(contents, " o Something important") > > I tried pasting the actual symbol into the string but it displays a square > in the app UI. ?How can I show symbols? ?I was also wondering about the > copyright (c) symbol. It's possible (well, likely) that the bullet symbol that you pasted in failed to display properly because it wasn't there in the font that your UI was using. You'd want to first confirm that those characters (bullet, or copyright) are available in your GUI's font, and then find out what character code to embed in the string. If you just wanted bullets, I also second Bartosz's suggestion of adding an icon to the label, on its left side. From tester.paul at gmail.com Wed Mar 31 11:03:47 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 31 Mar 2010 11:03:47 -0400 Subject: [fxruby-users] Need help getting ALT+F4 hotkey to work In-Reply-To: References: Message-ID: 2010/3/31 Bartosz Dziewo?ski > http://www.fxruby.org/doc/api/classes/Fox/FXAccelTable.html#M000142 > > You probably (I didn't test it) need to send SEL_CLOSE command to your > main window in third line (and then it will be catched by your second > line), using technique mentioned under that link. > > Read docs, they contain lots of info. > > I read the docs before I posted my question. They do contain lots of info but nothing that helped me. Can you provide an example to help me understand what you're suggesting? I don't know how to that. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tester.paul at gmail.com Wed Mar 31 11:17:34 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 31 Mar 2010 11:17:34 -0400 Subject: [fxruby-users] Can you display bullets in labels? In-Reply-To: References: <37c405481003301517w7fa44d1cq1bf9bb14ed650ace@mail.gmail.com> Message-ID: On 31 March 2010 10:44, Lyle Johnson wrote: > > It's possible (well, likely) that the bullet symbol that you pasted in > failed to display properly because it wasn't there in the font that > your UI was using. You'd want to first confirm that those characters > (bullet, or copyright) are available in your GUI's font, and then find > out what character code to embed in the string. > I thought the same thing - which explains why a square appeared in the UI when I included the bullet char in the string. Then I tried adding ascii codes to strings (e.g. {..) to see if they would display but that doesn't work either. I did manage to display the copyright symbol because it appears low enough in the ascii table and is part of all the system fonts. No luck with the bullet symbol though unless I change the font. > > If you just wanted bullets, I also second Bartosz's suggestion of > adding an icon to the label, on its left side. > > Add an icon as in a graphic image file? I can't say that I thought of that as an option. I could do that but this app is small and I want to keep it simple. I'd rather go with (ascii) asterisks before I add a graphic bullet image. Not as pretty, but good enough. Thanks for the info. Cheers. Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Wed Mar 31 11:46:42 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 31 Mar 2010 10:46:42 -0500 Subject: [fxruby-users] Need help getting ALT+F4 hotkey to work In-Reply-To: References: Message-ID: On Wed, Mar 31, 2010 at 10:03 AM, Paul Carvalho wrote: > I read the docs before I posted my question. ?They do contain lots of info > but nothing that helped me. > Can you provide an example to help me understand what you're suggesting? I > don't know how to that. What happens if you replace the third line with this: self.accelTable.addAccel( fxparseAccel( "Alt+F4" ), self, FXSEL(SEL_CLOSE, 0) ) ? From tester.paul at gmail.com Wed Mar 31 12:11:38 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 31 Mar 2010 12:11:38 -0400 Subject: [fxruby-users] Need help getting ALT+F4 hotkey to work In-Reply-To: References: Message-ID: Aha! You da man! Who da man? You da man! =) Thanks Lyle. That works perfectly. Cheers! On 31 March 2010 11:46, Lyle Johnson wrote: > > What happens if you replace the third line with this: > > self.accelTable.addAccel( fxparseAccel( "Alt+F4" ), self, > FXSEL(SEL_CLOSE, 0) ) > > ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyle at lylejohnson.name Wed Mar 31 12:15:19 2010 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 31 Mar 2010 11:15:19 -0500 Subject: [fxruby-users] Is there a way to enforce a minimum (app) window size? In-Reply-To: <37c405481003301432s77fe91b8l750764cd1f75e27d@mail.gmail.com> References: <37c405481003301324i2e4562e3t3d28285692413380@mail.gmail.com> <57cf8f721003301359o71d4997aj8c56eb7bcf1999a0@mail.gmail.com> <37c405481003301432s77fe91b8l750764cd1f75e27d@mail.gmail.com> Message-ID: On Tue, Mar 30, 2010 at 4:32 PM, Paul Carvalho wrote: > I also changed the statusbar property to remove?STATUSBAR_WITH_DRAGCORNER. > ?Personally, I like that UI style, but it does some funky UI bug thing if > you drag the status bar instead of the window edge. > I can live without the bug.. especially since I'll likely be passing my app > onto other testers. ;) That sounds like a bug in FOX itself, not the FXRuby layer. If it's important, I'd try posting to the FOX mailing list to see if anyone has a workaround. From tester.paul at gmail.com Wed Mar 31 17:01:34 2010 From: tester.paul at gmail.com (Paul Carvalho) Date: Wed, 31 Mar 2010 17:01:34 -0400 Subject: [fxruby-users] Is there a way to enforce a minimum (app) window size? In-Reply-To: References: <37c405481003301324i2e4562e3t3d28285692413380@mail.gmail.com> <57cf8f721003301359o71d4997aj8c56eb7bcf1999a0@mail.gmail.com> <37c405481003301432s77fe91b8l750764cd1f75e27d@mail.gmail.com> Message-ID: You can see the bug using the button.rb example program. Change "DECOR_ALL" to: "DECOR_TITLE|DECOR_STRETCHABLE|DECOR_CLOSE" Now, when you resize the window using the status bar drag-corner (the first time), it stops at the minimum size to show all the elements. (good) Drag the status bar corner again, and I see the window shrinks within the window. It looks ugly. (not good) I'm using an older version of Fox (1.6.28) and FXRuby (1.6.12) and I don't have the time right now to try the example on newer/more recent versions. I'd like to, but I'm pressed for time to finish my current project. If I can, I'll try it out on newer builds later - maybe in a few weeks. Thanks for the feedback about the mailing list. Cheers. On 31 March 2010 12:15, Lyle Johnson wrote: > On Tue, Mar 30, 2010 at 4:32 PM, Paul Carvalho wrote: > > > I also changed the statusbar property to > remove STATUSBAR_WITH_DRAGCORNER. > > Personally, I like that UI style, but it does some funky UI bug thing if > > you drag the status bar instead of the window edge. > > I can live without the bug.. especially since I'll likely be passing my > app > > onto other testers. ;) > > That sounds like a bug in FOX itself, not the FXRuby layer. If it's > important, I'd try posting to the FOX mailing list to see if anyone > has a workaround. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: