From natarajsn at gmail.com Wed Jun 3 00:43:26 2009 From: natarajsn at gmail.com (Nataraj S Narayan) Date: Wed, 3 Jun 2009 10:13:26 +0530 Subject: [fxruby-users] [fxruby] components for Photo and audio input Message-ID: <630286c70906022143n4e98d074k8e7de58223b6e44@mail.gmail.com> Hi I am using Fox16. I need to write a form which has usual FX..Frame,FXButton ,FXTextField etc, also a component which will accept photos and voice recordings. How do I go about this? Does my app need to call programs like Gphoto ? If so can I import the gphoto and ffmpeg outputs into my form? My need is to capture input from a webcam and voice recorder via my input form. regards Nataraj S Narayan From jeroen at fox-toolkit.org Wed Jun 3 01:55:50 2009 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Wed, 3 Jun 2009 00:55:50 -0500 Subject: [fxruby-users] [fxruby] components for Photo and audio input In-Reply-To: <630286c70906022143n4e98d074k8e7de58223b6e44@mail.gmail.com> References: <630286c70906022143n4e98d074k8e7de58223b6e44@mail.gmail.com> Message-ID: <200906030055.51596.jeroen@fox-toolkit.org> On Tuesday 02 June 2009, Nataraj S Narayan wrote: > Hi > > I am using Fox16. I need to write a form which has usual > FX..Frame,FXButton ,FXTextField etc, also a component which will accept > photos and voice recordings. How do I go about this? Does my app need to > call programs like Gphoto ? If so can I import the gphoto and ffmpeg > outputs into my form? > > My need is to capture input from a webcam and voice recorder via my input form. You may be able to use FXImageView or FXImageFrame, these display an image. The mechanics of setting the image depend a little bit on where it comes from. My suggestion is to determine which way the image goes into the application first. Possibilities are from a file, via drag and drop, or maybe through a communication socket? Its difficult to answer the question without this info. On the other hand, reading images from streams [files, memory stream, etc] is probably the most flexible. - Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 00:40 06/ 3/2009 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ From natarajsn at gmail.com Sat Jun 6 00:23:39 2009 From: natarajsn at gmail.com (Nataraj S Narayan) Date: Sat, 6 Jun 2009 09:53:39 +0530 Subject: [fxruby-users] FXRuby Installation failing Message-ID: <630286c70906052123x5d862692sb7070cbce7d674f1@mail.gmail.com> Hi Which is the most stable version of FXRuby that can be used with ruby 1.8.7 (2008-05-31 patchlevel 0)? I am having lots of trouble installing fxruby using gem. root at at91sam9263ek:~$ gem install fxruby-1.6.19.gem Building native extensions. This could take a while... ERROR: Error installing fxruby-1.6.19.gem: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19/ext/fox16/gem_make.out root at at91sam9263ek:~$ cat /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19/ext/fox16/gem_make.out /usr/local/bin/ruby extconf.rb The foxlib example program 'Calculator' works well. Using libFOX-1.6.so.0.0.36. But fxruby install doesnt finish. During my previous install on I used libFOX-1.6.so.0.0.34. Could it be any bug in ibFOX-1.6.so.0.0.36? Trying out a source install now. Please help me. regards Nataraj From lyle at lylejohnson.name Sun Jun 7 16:30:13 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Sun, 7 Jun 2009 15:30:13 -0500 Subject: [fxruby-users] FXRuby Installation failing In-Reply-To: <630286c70906052123x5d862692sb7070cbce7d674f1@mail.gmail.com> References: <630286c70906052123x5d862692sb7070cbce7d674f1@mail.gmail.com> Message-ID: On Jun 5, 2009, at 11:23 PM, Nataraj S Narayan wrote: > Which is the most stable version of FXRuby that can be used with ruby > 1.8.7 (2008-05-31 patchlevel 0)? FXRuby should be compatible (which is to say, compileable-against) any release of Ruby 1.8 or 1.9. I'm running Ruby 1.8.6-p368, but Ruby 1.8.7-p0 should *probably* work too. > I am having lots of trouble installing fxruby using gem. > > root at at91sam9263ek:~$ gem install fxruby-1.6.19.gem > Building native extensions. This could take a while... > ERROR: Error installing fxruby-1.6.19.gem: > ERROR: Failed to build gem native extension. > > /usr/local/bin/ruby extconf.rb > > Gem files will remain installed in > /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19 for inspection. > Results logged to > /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19/ext/fox16/gem_make.out > > root at at91sam9263ek:~$ cat > /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19/ext/fox16/gem_make.out > /usr/local/bin/ruby extconf.rb So what are the contents of this file: /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19/ext/fox16/gem_make.out or is it empty? > The foxlib example program 'Calculator' works well. Using > libFOX-1.6.so.0.0.36. But fxruby install doesnt finish. OK, but I'll need some information other than "it doesn't build" to figure out what's going on. The gem_make.out file should tell us that. > During my previous install on I used libFOX-1.6.so.0.0.34. Could it be > any bug in ibFOX-1.6.so.0.0.36? No. > Trying out a source install now. OK, if that doesn't work either, please send me the gem_make.out file from your failed gem installation. Thanks, Lyle From natarajsn at gmail.com Mon Jun 8 00:44:52 2009 From: natarajsn at gmail.com (Nataraj S Narayan) Date: Mon, 8 Jun 2009 10:14:52 +0530 Subject: [fxruby-users] FXRuby Installation failing In-Reply-To: References: <630286c70906052123x5d862692sb7070cbce7d674f1@mail.gmail.com> Message-ID: <630286c70906072144m45d335f3u698d971c05289b9@mail.gmail.com> Hi Lyle Got it working by fiddling a lot. I am working on an Arm9 embedded board with Linux. Had to do a lot of cross compiling, copying folders etc. On a project with dead line on 10th. I may need your help profusely. Kindly help me out. I am in the process of adding linux drivers for Camera, and biometric using finger print. After that I need Ruby to talk to the drivers or libraries and get the validation onto FXruby forms. Please keep in touch as I am desperate. Thanking you Nataraj On Mon, Jun 8, 2009 at 2:00 AM, Lyle Johnson wrote: > > On Jun 5, 2009, at 11:23 PM, Nataraj S Narayan wrote: > >> Which is the most stable version of FXRuby that can be used with ruby >> 1.8.7 (2008-05-31 patchlevel 0)? > > FXRuby should be compatible (which is to say, compileable-against) any > release of Ruby 1.8 or 1.9. I'm running Ruby 1.8.6-p368, but Ruby 1.8.7-p0 > should *probably* work too. > >> I am having lots of trouble installing fxruby using gem. >> >> root at at91sam9263ek:~$ gem install fxruby-1.6.19.gem >> Building native extensions. This could take a while... >> ERROR: Error installing fxruby-1.6.19.gem: >> ERROR: Failed to build gem native extension. >> >> /usr/local/bin/ruby extconf.rb >> >> Gem files will remain installed in >> /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19 for inspection. >> Results logged to >> /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19/ext/fox16/gem_make.out >> >> root at at91sam9263ek:~$ cat >> /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19/ext/fox16/gem_make.out >> /usr/local/bin/ruby extconf.rb > > So what are the contents of this file: > > > /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.19/ext/fox16/gem_make.out > > or is it empty? > >> The foxlib example program 'Calculator' works well. Using >> libFOX-1.6.so.0.0.36. But fxruby install doesnt finish. > > OK, but I'll need some information other than "it doesn't build" to figure > out what's going on. The gem_make.out file should tell us that. > >> During my previous install on I used libFOX-1.6.so.0.0.34. Could it be >> any bug in ibFOX-1.6.so.0.0.36? > > No. > >> Trying out a source install now. > > OK, if that doesn't work either, please send me the gem_make.out file from > your failed gem installation. > > Thanks, > > Lyle > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users > From mfalcon at me.com Tue Jun 9 21:36:16 2009 From: mfalcon at me.com (Micheal Falcon) Date: Tue, 09 Jun 2009 20:36:16 -0500 Subject: [fxruby-users] NOOB question Message-ID: <87522813589101667426675997450212895810-Webmail@me.com> Hi all, I have been working with FXRuby for a few weeks and have run into a problem. I have a list box and I would like to update the value displayed in that list box whenever certain events happen in my program. I have used a text field with a FXDataTarget and whenever I update the FXDataTarget it would update in my text field. I can't get this working for a list box. Could I get some explanation on why this is not working, and maybe a suggestion on what I should be doing. Thanks Mike From lyle at lylejohnson.name Wed Jun 10 12:48:20 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 10 Jun 2009 11:48:20 -0500 Subject: [fxruby-users] Mailing list problem? In-Reply-To: References: Message-ID: <293736C2-E8DD-4F0C-8E15-3E8CEEF10391@lylejohnson.name> On Jun 9, 2009, at 6:10 PM, jonathan coupe wrote: > Hi - I've been subscribed for a week (?) now and haven't received > any mail from the list. I'm supposed to be receiving the list in > digest form. Is there some kind of problem, or has traffic > ***really*** dropped off? Mailing list traffic has been pretty light lately, but there have certainly been a few messages posted to the list over the last week or so. For reference, the mailing list archive for June is here: http://rubyforge.org/pipermail/fxruby-users/2009-June/thread.html I don't know enough about how RubyForge's mailing list manager software works to guess what the problem might be. Perhaps there's some threshold message count that hasn't been exceeded for it to warrant sending you a digest? Hope this helps, Lyle From vjoel at path.berkeley.edu Wed Jun 10 13:52:55 2009 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Wed, 10 Jun 2009 10:52:55 -0700 Subject: [fxruby-users] NOOB question In-Reply-To: <87522813589101667426675997450212895810-Webmail@me.com> References: <87522813589101667426675997450212895810-Webmail@me.com> Message-ID: <4A2FF2F7.5030704@path.berkeley.edu> Micheal Falcon wrote: > Hi all, > I have been working with FXRuby for a few weeks and have run into a problem. I have a list box and I would like to update the value displayed in that list box whenever certain events happen in my program. I have used a text field with a FXDataTarget and whenever I update the FXDataTarget it would update in my text field. I can't get this working for a list box. Could I get some explanation on why this is not working, and maybe a suggestion on what I should be doing. Do you mean you want to update the entries contained in the list, or update the selection? -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From mfalcon at me.com Wed Jun 10 14:17:59 2009 From: mfalcon at me.com (Micheal Falcon) Date: Wed, 10 Jun 2009 13:17:59 -0500 Subject: [fxruby-users] NOOB question In-Reply-To: <4A2FF2F7.5030704@path.berkeley.edu> References: <87522813589101667426675997450212895810-Webmail@me.com> <4A2FF2F7.5030704@path.berkeley.edu> Message-ID: <15511608252119074143561624019325030527-Webmail2@me.com> The selection displayed in the list box. On Wednesday, June 10, 2009, at 12:52PM, "Joel VanderWerf" wrote: >Micheal Falcon wrote: >> Hi all, >> I have been working with FXRuby for a few weeks and have run into a problem. I have a list box and I would like to update the value displayed in that list box whenever certain events happen in my program. I have used a text field with a FXDataTarget and whenever I update the FXDataTarget it would update in my text field. I can't get this working for a list box. Could I get some explanation on why this is not working, and maybe a suggestion on what I should be doing. > >Do you mean you want to update the entries contained in the list, or >update the selection? > >-- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 >_______________________________________________ >fxruby-users mailing list >fxruby-users at rubyforge.org >http://rubyforge.org/mailman/listinfo/fxruby-users > > From mfalcon at me.com Wed Jun 10 14:42:53 2009 From: mfalcon at me.com (Micheal Falcon) Date: Wed, 10 Jun 2009 13:42:53 -0500 Subject: [fxruby-users] NOOB question In-Reply-To: <4A2FF2F7.5030704@path.berkeley.edu> References: <87522813589101667426675997450212895810-Webmail@me.com> <4A2FF2F7.5030704@path.berkeley.edu> Message-ID: <41458977780592114496641657555209934106-Webmail2@me.com> On Wednesday, June 10, 2009, at 12:52PM, "Joel VanderWerf" wrote: >Micheal Falcon wrote: >> Hi all, >> I have been working with FXRuby for a few weeks and have run into a problem. I have a list box and I would like to update the value displayed in that list box whenever certain events happen in my program. I have used a text field with a FXDataTarget and whenever I update the FXDataTarget it would update in my text field. I can't get this working for a list box. Could I get some explanation on why this is not working, and maybe a suggestion on what I should be doing. > >Do you mean you want to update the entries contained in the list, or >update the selection? > >-- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 >_______________________________________________ >fxruby-users mailing list >fxruby-users at rubyforge.org >http://rubyforge.org/mailman/listinfo/fxruby-users > > From mfalcon at me.com Wed Jun 10 14:45:00 2009 From: mfalcon at me.com (Micheal Falcon) Date: Wed, 10 Jun 2009 13:45:00 -0500 Subject: [fxruby-users] NOOB question In-Reply-To: <4A2FF2F7.5030704@path.berkeley.edu> References: <87522813589101667426675997450212895810-Webmail@me.com> <4A2FF2F7.5030704@path.berkeley.edu> Message-ID: <66575423809202689720854337292985998012-Webmail2@me.com> I solved this problem easy enough. I am using setCurrentItem method which is not listed in the API for a FXListBox, but is listed for a FXComboBox. It exists though for the list box and works. Is there a better way? Thanks Mike On Wednesday, June 10, 2009, at 12:52PM, "Joel VanderWerf" wrote: >Micheal Falcon wrote: >> Hi all, >> I have been working with FXRuby for a few weeks and have run into a problem. I have a list box and I would like to update the value displayed in that list box whenever certain events happen in my program. I have used a text field with a FXDataTarget and whenever I update the FXDataTarget it would update in my text field. I can't get this working for a list box. Could I get some explanation on why this is not working, and maybe a suggestion on what I should be doing. > >Do you mean you want to update the entries contained in the list, or >update the selection? > >-- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 >_______________________________________________ >fxruby-users mailing list >fxruby-users at rubyforge.org >http://rubyforge.org/mailman/listinfo/fxruby-users > > From natarajsn at gmail.com Thu Jun 11 06:45:34 2009 From: natarajsn at gmail.com (Nataraj S Narayan) Date: Thu, 11 Jun 2009 16:15:34 +0530 Subject: [fxruby-users] FXVerticalFrame clearing compos Message-ID: <630286c70906110345yf95568akfe001bf579fbe6ae@mail.gmail.com> Hi How do i clear the FXTextFields of a FXVerticalFrame in one go? What is the structure that holds the components defined for the FXVerticalFrame? regards Nataraj From jeroen at fox-toolkit.org Thu Jun 11 10:56:25 2009 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Thu, 11 Jun 2009 09:56:25 -0500 Subject: [fxruby-users] FXVerticalFrame clearing compos In-Reply-To: <630286c70906110345yf95568akfe001bf579fbe6ae@mail.gmail.com> References: <630286c70906110345yf95568akfe001bf579fbe6ae@mail.gmail.com> Message-ID: <200906110956.25742.jeroen@fox-toolkit.org> On Thursday 11 June 2009, Nataraj S Narayan wrote: > Hi > > > How do i clear the FXTextFields of a FXVerticalFrame in one go? > What is the structure that holds the components defined for the FXVerticalFrame? You can find the first child of a FXComposite by calling child=composite->getFirst() and subsequent siblings with: child=child->getNext() until child==NULL. Of course, no guarantee that they're FXTextFields. I recommend: textfield=dynamic_cast(child); if(textfield){ ... } or: if(child->isMemberOf(&FXTextField::metaClass)){ textfield=(FXTextField*)child; ... } If you KNOW they're FXTextFields, you can of course omit the check and simply use static_cast(child) instead, which is definitely faster. - Jeroen From vjoel at path.berkeley.edu Thu Jun 11 11:34:24 2009 From: vjoel at path.berkeley.edu (Joel VanderWerf) Date: Thu, 11 Jun 2009 08:34:24 -0700 Subject: [fxruby-users] FXVerticalFrame clearing compos In-Reply-To: <630286c70906110345yf95568akfe001bf579fbe6ae@mail.gmail.com> References: <630286c70906110345yf95568akfe001bf579fbe6ae@mail.gmail.com> Message-ID: <4A312400.3060800@path.berkeley.edu> Nataraj S Narayan wrote: > Hi > > > How do i clear the FXTextFields of a FXVerticalFrame in one go? > What is the structure that holds the components defined for the FXVerticalFrame? IIRC, you can use the #children method: frame.children.each do |child| child.text = "" end -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 From soumyanath.c at gmail.com Fri Jun 12 09:39:56 2009 From: soumyanath.c at gmail.com (Soumyanath) Date: Fri, 12 Jun 2009 19:09:56 +0530 Subject: [fxruby-users] Any graph tool to use with FXRuby In-Reply-To: <66575423809202689720854337292985998012-Webmail2@me.com> References: <87522813589101667426675997450212895810-Webmail@me.com> <4A2FF2F7.5030704@path.berkeley.edu> <66575423809202689720854337292985998012-Webmail2@me.com> Message-ID: <4A325AAC.7040700@gmail.com> Hi, Is there any graph making tool to use with FXRuby? I tried using gruff, but not able to make it work so far. -- Regards Soumyanath From ja_bowen at yahoo.com Sat Jun 13 17:23:44 2009 From: ja_bowen at yahoo.com (jabowen) Date: Sat, 13 Jun 2009 14:23:44 -0700 (PDT) Subject: [fxruby-users] updata of a value from outside Message-ID: <23988603.post@talk.nabble.com> I have a button in the test gui that runs a random number generator class outside of the gui. How do I get the field to update inside the gui? It creates the number but and puts it but does not update the field. require 'fox16' include Fox class GenNum def current_addr $current_addr = rand(0) end end class TestRun < FXMainWindow def initialize(app) super(app, "Test Run", :width => 400, :height => 100) @rand_num = GenNum.new p = FXVerticalFrame.new(self, :opts => LAYOUT_FILL_X|LAYOUT_CENTER_Y) $intTarget = FXDataTarget.new($current_addr.to_s) FXTextField.new(p, 20, $intTarget, FXDataTarget::ID_VALUE, LAYOUT_CENTER_Y|LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_ROW) activate_button = FXButton.new(p, "test_run", :opts => BUTTON_NORMAL|LAYOUT_CENTER_X) activate_button.connect(SEL_COMMAND) do |sender, sel, data| @rand_num.current_addr p $current_addr end end def create super show(PLACEMENT_SCREEN) end end if __FILE__ == $0 FXApp.new do |app| TestRun.new(app) app.create app.run end end -- View this message in context: http://www.nabble.com/updata-of-a-value-from-outside-tp23988603p23988603.html Sent from the FXRuby Users mailing list archive at Nabble.com. From lyle at lylejohnson.name Sun Jun 14 04:38:58 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Sun, 14 Jun 2009 03:38:58 -0500 Subject: [fxruby-users] updata of a value from outside In-Reply-To: <23988603.post@talk.nabble.com> References: <23988603.post@talk.nabble.com> Message-ID: <5F1332A0-5868-4567-89A3-729C5DF158FD@lylejohnson.name> On Jun 13, 2009, at 4:23 PM, jabowen wrote: > I have a button in the test gui that runs a random number generator > class > outside of the gui. How do I get the field to update inside the > gui? It > creates the number but and puts it but does not update the field. You need to be sure to update the value of the data target. Try changing your button action to this: activate_button.connect(SEL_COMMAND) do @rand_num.current_addr @intTarget.value = $current_addr end Hope this helps, Lyle From pijnacker at dse.nl Thu Jun 18 06:23:39 2009 From: pijnacker at dse.nl (Ronald Pijnacker) Date: Thu, 18 Jun 2009 12:23:39 +0200 Subject: [fxruby-users] HTML widget Message-ID: <20090618102339.GA21697@asus> Hi all, I thought there would be some simple html renderer for Fox, but I cannot seem to find one. Am I missing it? Ronald From lyle at lylejohnson.name Thu Jun 18 14:15:08 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Thu, 18 Jun 2009 14:15:08 -0400 Subject: [fxruby-users] HTML widget In-Reply-To: <20090618102339.GA21697@asus> References: <20090618102339.GA21697@asus> Message-ID: <0CF541DA-1AFE-4B19-8D57-29C70CE50E70@lylejohnson.name> I am not aware of any currently maintained HTML widgets for FOX or FXRuby. On Jun 18, 2009, at 6:23 AM, Ronald Pijnacker wrote: > Hi all, > > I thought there would be some simple html renderer for Fox, but I > cannot seem to find one. > Am I missing it? > > Ronald > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users From jeroen at fox-toolkit.org Thu Jun 18 16:30:59 2009 From: jeroen at fox-toolkit.org (Jeroen van der Zijp) Date: Thu, 18 Jun 2009 15:30:59 -0500 Subject: [fxruby-users] HTML widget In-Reply-To: <20090618102339.GA21697@asus> References: <20090618102339.GA21697@asus> Message-ID: <200906181530.59141.jeroen@fox-toolkit.org> On Thursday 18 June 2009, Ronald Pijnacker wrote: > Hi all, > > I thought there would be some simple html renderer for Fox, but I > cannot seem to find one. > Am I missing it? I miss it too. This is obviosly a major undertaking, probably of magnitude exceeding the FOX library itself. - Jeroen From philippe.lang at attiksystem.ch Fri Jun 19 03:05:51 2009 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Fri, 19 Jun 2009 09:05:51 +0200 Subject: [fxruby-users] HTML widget References: <20090618102339.GA21697@asus> <200906181530.59141.jeroen@fox-toolkit.org> Message-ID: fxruby-users-bounces at rubyforge.org wrote: > On Thursday 18 June 2009, Ronald Pijnacker wrote: >> Hi all, >> >> I thought there would be some simple html renderer for Fox, but I >> cannot seem to find one. Am I missing it? > > I miss it too. This is obviosly a major undertaking, probably of > magnitude exceeding the FOX library itself. I never tried that before, but would it be possible to embed the Firefox HTML renderer inside a fox object maybe? Philippe From marlene at phillipses.com Fri Jun 19 13:50:32 2009 From: marlene at phillipses.com (Marlene Phillips) Date: Fri, 19 Jun 2009 10:50:32 -0700 Subject: [fxruby-users] New to FXRuby Can't justify a label Message-ID: <4A3BCFE8.1050301@phillipses.com> I'm trying to wrap my head around Ruby, FXRuby, etc., getting back into programming after 15+ years away. Went through the Pragmatic Programmer tutorial chapters, now trying to justify a label in a simple main window. I'm obviously missing something basic. code is here: require 'fox16' include Fox class Marlene1 < FXMainWindow def initialize(app) super(app, "Second window", :width=>600, :height=>400) label_icon = FXJPGIcon.new(app, File.open("mlp.jpg", "rb").read) label = FXLabel.new(self, "This is a label", :icon => label_icon, :opts => JUSTIFY_RIGHT|JUSTIFY_BOTTOM|ICON_BEFORE_TEXT) label2 = FXLabel.new(self, "sunken label", :opts => JUSTIFY_BOTTOM) show(PLACEMENT_SCREEN) end end if __FILE__ == $0 FXApp.new do |app| Marlene1.new(app) app.create app.run end end No matter what I do, I can't get the label to the bottom of the window (or any kind of justification, for that matter.) I put the icon in so I could play with moving the label around. I tried changing the height and width of the label, no luck. I tried creating the label in an FXMatrix child window, and that was even worse - the labels and icons disappeared altogether until I resized the main window - then all of a sudden they all appeared again, but still not justified. What am I missing here? I'd sure appreciate help. Thanks! Marlene Phillips From rmelton at ball.com Fri Jun 19 13:57:56 2009 From: rmelton at ball.com (Melton, Ryan) Date: Fri, 19 Jun 2009 11:57:56 -0600 Subject: [fxruby-users] New to FXRuby Can't justify a label In-Reply-To: <4A3BCFE8.1050301@phillipses.com> References: <4A3BCFE8.1050301@phillipses.com> Message-ID: <2EC28B773AF39E47850AC45765483C2C026B2A54@AEROMSG2.AERO.BALL.COM> Some thoughts: Height and width of the label do nothing unless you give the LAYOUT_FIX_WIDTH and/or LAYOUT_FIX_HEIGHT options. You are not using a layout manager (FXVerticalFrame, etc.), so you get the default layout of the FXMainWindow which acts like a vertical frame stacking windows from the top left down. Justification only applies within the labels height/width so it can't do anything if the FXLabel is auto sized to be only the size of its text (which is what is happening). Try using LAYOUT_BOTTOM to move it to the bottom of the FXMainWindow. Ryan -----Original Message----- From: fxruby-users-bounces at rubyforge.org [mailto:fxruby-users-bounces at rubyforge.org] On Behalf Of Marlene Phillips Sent: Friday, June 19, 2009 11:51 AM To: fxruby-users at rubyforge.org Subject: [fxruby-users] New to FXRuby Can't justify a label I'm trying to wrap my head around Ruby, FXRuby, etc., getting back into programming after 15+ years away. Went through the Pragmatic Programmer tutorial chapters, now trying to justify a label in a simple main window. I'm obviously missing something basic. code is here: require 'fox16' include Fox class Marlene1 < FXMainWindow def initialize(app) super(app, "Second window", :width=>600, :height=>400) label_icon = FXJPGIcon.new(app, File.open("mlp.jpg", "rb").read) label = FXLabel.new(self, "This is a label", :icon => label_icon, :opts => JUSTIFY_RIGHT|JUSTIFY_BOTTOM|ICON_BEFORE_TEXT) label2 = FXLabel.new(self, "sunken label", :opts => JUSTIFY_BOTTOM) show(PLACEMENT_SCREEN) end end if __FILE__ == $0 FXApp.new do |app| Marlene1.new(app) app.create app.run end end No matter what I do, I can't get the label to the bottom of the window (or any kind of justification, for that matter.) I put the icon in so I could play with moving the label around. I tried changing the height and width of the label, no luck. I tried creating the label in an FXMatrix child window, and that was even worse - the labels and icons disappeared altogether until I resized the main window - then all of a sudden they all appeared again, but still not justified. What am I missing here? I'd sure appreciate help. Thanks! Marlene Phillips _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. From marlene at phillipses.com Fri Jun 19 16:53:53 2009 From: marlene at phillipses.com (Marlene Phillips) Date: Fri, 19 Jun 2009 13:53:53 -0700 Subject: [fxruby-users] New to FXRuby Can't justify a label In-Reply-To: <2EC28B773AF39E47850AC45765483C2C026B2A54@AEROMSG2.AERO.BALL.COM> References: <2EC28B773AF39E47850AC45765483C2C026B2A54@AEROMSG2.AERO.BALL.COM> Message-ID: <4A3BFAE1.8030605@phillipses.com> Thanks so much for your help! Follow up question: Any clues about why, if I use the FXMatrix layout manager, I get a blank window at first, but if I minimize or maximize the window, my icon and labels show up? Thanks again, Marlene From natarajsn at gmail.com Sat Jun 20 04:28:55 2009 From: natarajsn at gmail.com (Nataraj S Narayan) Date: Sat, 20 Jun 2009 13:58:55 +0530 Subject: [fxruby-users] IDE Message-ID: <630286c70906200128p6ef000edp477947b579ce99fc@mail.gmail.com> Hi Do we have an IDE integrated environment for fx-ruby? Something like Visual Basic or Delphi? Or something like Dabo for Python? I know one can get along well without any IDE for Ruby development. I am in the midst of some VB and dot net cats, who flaunt about the Visual development env. regards Nataraj From dglnz at yahoo.com Sun Jun 21 20:02:42 2009 From: dglnz at yahoo.com (dave L) Date: Sun, 21 Jun 2009 17:02:42 -0700 (PDT) Subject: [fxruby-users] Beginner question Message-ID: <918129.45637.qm@web30002.mail.mud.yahoo.com> Meinrad, I for one would like more tutorials on using fxGUIb. and how to use some of the other controls like matrix (presume it's a table type widgit and with little help info within each popup ? button within event manager doesn't help me much either - or is fxRI the one i need??). I must admit i am not the brightest programmer and what might seem self explaitory to some is likely to be hard for me to interpret. I learn best by doing but as of late haven't had an itch to scratch so to speak. but have wanted to dabble with fxGUIb lately but - lacking good help/pointers and what i'm after is _very_ basic things like capturing the enter keypress. To get a response into a label (but later have it call a sqlite3 Select function) and have data servered up. think there is a data awear widget but being very much a novice I've not looked round much. any pointers to better or more fleshed out tutorials? rdgs, Dave. --- On Mon, 22/6/09, Meinrad Recheis wrote: > From: Meinrad Recheis > Subject: Re: [fxruby-users] Beginner question > To: fxruby-users at rubyforge.org > Received: Monday, 22 June, 2009, 5:55 AM > On Sun, Jun > 21, 2009 at 7:34 PM, Benjamin Sebastian Kolz > wrote: > > > > > > > > Thank you for your response! > > Do you know if there is any FXRuby turorial which starts at > the beginning and explains the commands with details? > I bought the book "FX Ruby: Create Lean and Mean GUIs > with Ruby", but its quite difficult for me to follow > the commands. > > I would need a tutorial that explains step by step the > command with examples... is there any? > > Thanks for your answers... > > you might want to play around with FoxGUIb which will help > you understand how to build fxruby GUIs. there is also an > accompanying users guide that is targeted on beginners > > > http://fox-tool.rubyforge.org/?<--- > foxguib home > http://www.mikeparr.info/rubyguib/foxguibhome.htm?<--- > users guide > > > hth, > -- Henon > > > > --Git# --> > Git for .NET > > > > > > -----Inline Attachment Follows----- > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users From dglnz at yahoo.com Mon Jun 22 03:26:12 2009 From: dglnz at yahoo.com (dave L) Date: Mon, 22 Jun 2009 00:26:12 -0700 (PDT) Subject: [fxruby-users] Beginner question In-Reply-To: <43d756720906212222p4f98a058l39d98dffe47337f0@mail.gmail.com> References: <918129.45637.qm@web30002.mail.mud.yahoo.com> <43d756720906212222p4f98a058l39d98dffe47337f0@mail.gmail.com> Message-ID: <155278.67971.qm@web30005.mail.mud.yahoo.com> Still it's very useful and many thanks for making it - Dave. ________________________________ From: Meinrad Recheis To: fxruby-users at rubyforge.org Sent: Monday, 22 June, 2009 5:22:40 PM Subject: Re: [fxruby-users] Beginner question On Mon, Jun 22, 2009 at 2:02 AM, dave L wrote: >>Meinrad, > >>I for one would like more tutorials on using fxGUIb. > >>and how to use some of the other controls like matrix (presume it's a table type widgit and with little help info within each popup ? button within event manager doesn't help me much either - or is fxRI the one i need??). > > >>I must admit i am not the brightest programmer and what might seem self explaitory to some is likely to be hard for me to interpret. > >>I learn best by doing but as of late haven't had an itch to scratch so to speak. > >>but have wanted to dabble with fxGUIb lately but - lacking good help/pointers and what i'm after is _very_ basic things like capturing the enter keypress. To get a response into a label (but later have it call a sqlite3 Select function) and have data servered up. > >>think there is a data awear widget but being very much a novice I've not looked round much. > >>any pointers to better or more fleshed out tutorials? > >>rdgs, > >>Dave. > Sorry there are no other tuts that I know of about foxGUIb. I like hacking code and don't like writing tutorials ;) .... I suggest you read the FXRuby guide and/or Lyles book. FoxGUIb is a tool I wrote to help me and my co-workers with GUI creation. I made it open source since I felt others will find it useful AS IT IS with all its limitations and problems but I have other goals now and would like to move on. If you have any questions about fxruby or guib, you are welcome to ask here on the list. Regards, -- Henon --Git# --> Git for .NET -------------- next part -------------- An HTML attachment was scrubbed... URL: From natarajsn at gmail.com Tue Jun 23 04:27:26 2009 From: natarajsn at gmail.com (Nataraj S Narayan) Date: Tue, 23 Jun 2009 13:57:26 +0530 Subject: [fxruby-users] Fx-ruby and C++ Message-ID: <630286c70906230127x4972d777lc2b3aea62612ea01@mail.gmail.com> Hi Are there tools to convert fx-ruby code to equivalent C++ code? I have developed a decent App for a client of my company using fxruby. But it seems that the customer has invested in in C++ devleopers . He is worried about interfacing problems of his code with Ruby. Tough time to educate somebody about merits of Ruby and also to retain the order during these days of recession. Please suggest some ways. regards Nataraj From marlene at phillipses.com Tue Jun 23 14:25:18 2009 From: marlene at phillipses.com (Marlene Phillips) Date: Tue, 23 Jun 2009 11:25:18 -0700 Subject: [fxruby-users] Learning FXRuby please help! Message-ID: <4A411E0E.9030808@phillipses.com> Hi all, I'm trying to get text on to the screen in response to pressing a button. This code doesn't work, and I don't know why. My puts command says that the window is shown, but it's not displayed. Also, it seems to me that there should be an easier way to get text on a screen in response to pressing a button. Any hints? Thanks! Marlene require 'fox16' include Fox class Lookup < FXMainWindow def initialize(app) super(app, "Lookup window", :width=>400, :height=>600, :opts => DECOR_ALL|LAYOUT_FILL_X|LAYOUT_FILL_Y) bframe = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X) hearButton = FXButton.new(bframe, "Do you hear me?") yesWindow = FXHorizontalFrame.new(self, :opts => FRAME_GROOVE|LAYOUT_FILL_X) yesLabel = FXLabel.new(yesWindow,"Yes") yesWindow.hide puts "window shown?" + yesWindow.shown?.to_s hearButton.connect(SEL_COMMAND) do |sender,sel, data| yesWindow.create yesWindow.show puts "pushed hear button" puts "window shown?" + yesWindow.shown?.to_s end end def create super show(PLACEMENT_SCREEN) end end if __FILE__ == $0 FXApp.new do |app| Lookup.new(app) app.create app.run end end From philippe.lang at attiksystem.ch Wed Jun 24 02:04:31 2009 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Wed, 24 Jun 2009 08:04:31 +0200 Subject: [fxruby-users] Learning FXRuby please help! References: <4A411E0E.9030808@phillipses.com> Message-ID: fxruby-users-bounces at rubyforge.org wrote: > Hi all, > > I'm trying to get text on to the screen in response to pressing a > button. This code doesn't work, and I don't know why. My puts command > says that the window is shown, but it's not displayed. > > Also, it seems to me that there should be an easier way to get text > on a screen in response to pressing a button. Any hints? Thanks! > > Marlene > > require 'fox16' > include Fox > > class Lookup < FXMainWindow > def initialize(app) > super(app, "Lookup window", :width=>400, :height=>600, > :opts => DECOR_ALL|LAYOUT_FILL_X|LAYOUT_FILL_Y) > bframe = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X) > hearButton = FXButton.new(bframe, "Do you hear me?") > yesWindow = FXHorizontalFrame.new(self, :opts => > FRAME_GROOVE|LAYOUT_FILL_X) > yesLabel = FXLabel.new(yesWindow,"Yes") > yesWindow.hide > puts "window shown?" + yesWindow.shown?.to_s > hearButton.connect(SEL_COMMAND) do |sender,sel, data| > yesWindow.create > yesWindow.show > puts "pushed hear button" > puts "window shown?" + yesWindow.shown?.to_s > end > end > > def create > super > show(PLACEMENT_SCREEN) > end > > end > > if __FILE__ == $0 > FXApp.new do |app| > Lookup.new(app) > app.create > app.run > end > end > > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users Hi, You needed a call to self.recalc... Best regards, Philippe Lang ------------ require 'fox16' include Fox class Lookup < FXMainWindow def initialize(app) super(app, "Lookup window", :width=>400, :height=>600, :opts => DECOR_ALL|LAYOUT_FILL_X|LAYOUT_FILL_Y) bframe = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X) hearButton = FXButton.new(bframe, "Do you hear me?") yesWindow = FXHorizontalFrame.new(self, :opts => FRAME_GROOVE|LAYOUT_FILL_X) yesLabel = FXLabel.new(yesWindow,"Yes") yesWindow.hide puts "window shown?" + yesWindow.shown?.to_s hearButton.connect(SEL_COMMAND) do |sender,sel, data| #yesWindow.create NOT NEEDED self.recalc yesWindow.show puts "pushed hear button" puts "window shown?" + yesWindow.shown?.to_s end end def create super show(PLACEMENT_SCREEN) end end if __FILE__ == $0 FXApp.new do |app| Lookup.new(app) app.create app.run end end From marlene at phillipses.com Wed Jun 24 02:22:09 2009 From: marlene at phillipses.com (Marlene Phillips) Date: Tue, 23 Jun 2009 23:22:09 -0700 Subject: [fxruby-users] Beginner Q: can't get window to show in response to button press Message-ID: <4A41C611.40409@phillipses.com> I'm trying to get text on to the screen in response to pressing a button. My puts command says that the window is shown, but it's not displayed. require 'fox16' include Fox class Lookup < FXMainWindow def initialize(app) super(app, "Lookup window", :width=>400, :height=>600,:opts => DECOR_ALL|LAYOUT_FILL_X|LAYOUT_FILL_Y) bframe = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X) hearButton = FXButton.new(bframe, "Do you hear me?") yesWindow = FXHorizontalFrame.new(self, :opts => FRAME_GROOVE|LAYOUT_FILL_X) yesLabel = FXLabel.new(yesWindow,"Yes") yesWindow.hide puts "window shown? " + yesWindow.shown?.to_s #returns false hearButton.connect(SEL_COMMAND) do |sender,sel, data| yesWindow.show #NOT DISPLAYED. WHY? puts "pushed hear button" puts "window shown?" + yesWindow.shown?.to_s # returns true end end def create super show(PLACEMENT_SCREEN) end end if __FILE__ == $0 FXApp.new do |app| Lookup.new(app) app.create app.run end end Sorry for the repost, I realized my title on the last one was not helpful. From marlene at phillipses.com Wed Jun 24 02:29:18 2009 From: marlene at phillipses.com (Marlene Phillips) Date: Tue, 23 Jun 2009 23:29:18 -0700 Subject: [fxruby-users] Learning FXRuby please help! In-Reply-To: References: Message-ID: <4A41C7BE.6060208@phillipses.com> Thanks for your help! Why do I need the self.recalc? And do you have a good source for me to read about this kind of thing so I don't need to keep asking "confused beginner" questions? From philippe.lang at attiksystem.ch Wed Jun 24 02:27:22 2009 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Wed, 24 Jun 2009 08:27:22 +0200 Subject: [fxruby-users] Learning FXRuby please help! References: <4A41C7BE.6060208@phillipses.com> Message-ID: fxruby-users-bounces at rubyforge.org wrote: > Thanks for your help! Why do I need the self.recalc? I have to say I don't know exactly. I thought a self.repaint or self.update would be sufficient, since your frame is only hidden and then shown. As a first guess, I would have said that you need a recalc when you create controls "dynamically", and need to invalidate the window structure. But your example shows that I'm wrong! For sure, Lyle or Jeroen have the answer! > And do you have > a good source for me to read about this kind of thing so I don't need > to keep asking "confused beginner" questions? Lyle has written a book: http://www.pragprog.com/titles/fxruby/fxruby Otherwise you have examples here: http://www.fxruby.org/doc/examples.html ... And the API reference: http://www.fxruby.org/doc/api/ Best regards, Philippe Lang From marlene at phillipses.com Wed Jun 24 02:50:01 2009 From: marlene at phillipses.com (Marlene Phillips) Date: Tue, 23 Jun 2009 23:50:01 -0700 Subject: [fxruby-users] Learning FXRuby please help! In-Reply-To: References: Message-ID: <4A41CC99.5070402@phillipses.com> Thanks again for your input. I've read through Lyle's book, which is where I'm trying to learn FXRuby from. It's a great book, but I don't see where there's anything about using self.recalc. While trying to solve this problem, I also tried to create the window in the button block, and it didn't work. I just now tried adding your self.recalc code, and it still doesn't show. Clearly I'm missing something that should be obvious! class Lookup < FXMainWindow def initialize(app) super(app, "Lookup window", :width=>400, :height=>600, :opts => DECOR_ALL|LAYOUT_FILL_X|LAYOUT_FILL_Y) bframe = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X) hearButton = FXButton.new(bframe, "Do you hear me?") hearButton.connect(SEL_COMMAND) do |sender,sel, data| @yesWindow = FXHorizontalFrame.new(self, :opts => FRAME_GROOVE|LAYOUT_FILL_X) yesLabel = FXLabel.new(@yesWindow,"Yes") self.recalc @yesWindow.show puts "pushed hear button" puts "window shown? " + @yesWindow.shown?.to_s end end From pijnacker at dse.nl Wed Jun 24 03:50:20 2009 From: pijnacker at dse.nl (Ronald Pijnacker) Date: Wed, 24 Jun 2009 09:50:20 +0200 Subject: [fxruby-users] Right mouse menu causes FXList to keep scrolling Message-ID: <20090624075020.GA5806@asus> Hi all, The user interface of an application of mine has a couple of FXLists that are filled enough to get a scroll-bar. I added a right-mouse pop-up menu to these lists as follows: @list.connect(SEL_RIGHTBUTTONPRESS) do |sender, sel, data| menu = FXMenuPane.new(@list) FXMenuCommand.new(menu, "Some entry") do |mc| mc.connect(SEL_COMMAND) { do_something } end menu.create menu.popup(nil, data.root_x, data.root_y) getApp().runModalWhileShown(menu) end The pop-up menu works without problems, but when I invoke it the underlying list keeps scrolling, even with no buttons pressed. Any ideas? Ronald From philippe.lang at attiksystem.ch Wed Jun 24 03:41:08 2009 From: philippe.lang at attiksystem.ch (Philippe Lang) Date: Wed, 24 Jun 2009 09:41:08 +0200 Subject: [fxruby-users] Learning FXRuby please help! References: <4A41CC99.5070402@phillipses.com> Message-ID: fxruby-users-bounces at rubyforge.org wrote: > Thanks again for your input. I've read through Lyle's book, which is > where I'm trying to learn FXRuby from. It's a great book, but I don't > see where there's anything about using self.recalc. > > While trying to solve this problem, I also tried to create the window > in the button block, and it didn't work. I just now tried adding your > self.recalc code, and it still doesn't show. Clearly I'm missing > something that should be obvious! > > class Lookup < FXMainWindow > def initialize(app) > super(app, "Lookup window", :width=>400, :height=>600, > :opts => DECOR_ALL|LAYOUT_FILL_X|LAYOUT_FILL_Y) > bframe = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X) > hearButton = FXButton.new(bframe, "Do you hear me?") > hearButton.connect(SEL_COMMAND) do |sender,sel, data| > @yesWindow = FXHorizontalFrame.new(self, :opts => > FRAME_GROOVE|LAYOUT_FILL_X) > yesLabel = FXLabel.new(@yesWindow,"Yes") > self.recalc > @yesWindow.show > puts "pushed hear button" > puts "window shown? " + @yesWindow.shown?.to_s > end > end When you create controls dynamically, don't forget to call "create", like this: require 'fox16' include Fox class Lookup < FXMainWindow def initialize(app) super(app, "Lookup window", :width=>400, :height=>600, :opts => DECOR_ALL|LAYOUT_FILL_X|LAYOUT_FILL_Y) bframe = FXHorizontalFrame.new(self, :opts => LAYOUT_FILL_X) hearButton = FXButton.new(bframe, "Do you hear me?") hearButton.connect(SEL_COMMAND) do |sender,sel, data| @yesWindow = FXHorizontalFrame.new(self, :opts => FRAME_GROOVE|LAYOUT_FILL_X) yesLabel = FXLabel.new(@yesWindow,"Yes") @yesWindow.create self.recalc @yesWindow.show puts "pushed hear button" puts "window shown? " + @yesWindow.shown?.to_s end end def create super show(PLACEMENT_SCREEN) end end if __FILE__ == $0 FXApp.new do |app| Lookup.new(app) app.create app.run end End Best regards, Philippe Lang Attik System From marlene at phillipses.com Wed Jun 24 04:05:08 2009 From: marlene at phillipses.com (Marlene Phillips) Date: Wed, 24 Jun 2009 01:05:08 -0700 Subject: [fxruby-users] Learning FXRuby please help! In-Reply-To: References: Message-ID: <4A41DE34.2080108@phillipses.com> That fixed this problem - your help has been invaluable. All of this is still rather confusing. So now I tried to layout the yesWindow on the bottom of the screen with a LAYOUT_BOTTOM when I define the yesWindow, but it still appears immediately under my buttons. Any clues what's happening there? hearButton.connect(SEL_COMMAND) do |sender,sel, data| @yesWindow = FXHorizontalFrame.new(self, :opts => FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_BOTTOM) yesLabel = FXLabel.new(@yesWindow,"Yes") I sure appreciate your time and help on this. Marlene Phillips From lyle at lylejohnson.name Wed Jun 24 10:13:02 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 24 Jun 2009 09:13:02 -0500 Subject: [fxruby-users] Beginner Q: can't get window to show in response to button press In-Reply-To: <4A41C611.40409@phillipses.com> References: <4A41C611.40409@phillipses.com> Message-ID: <15CAB39F-A48A-425F-BBE2-A43ECBD06C8E@lylejohnson.name> On Jun 24, 2009, at 1:22 AM, Marlene Phillips wrote: > I'm trying to get text on to the screen in response to pressing a > button. My puts command says that the window is shown, but it's not > displayed. The problem is that merely calling show() on a widget (in this case, the horizontal frame "yesWindow") doesn't mark the parent window's layout as dirty, and so it doesn't know that it needs to repaint its contents. The easiest way to fix this is to just add a call to recalc() after the call to show(), e.g. hearButton.connect(SEL_COMMAND) do yesWindow.show yesWindow.recalc end This topic is discussed in detail in Chapter 7 of the FXRuby book. Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby From lyle at lylejohnson.name Wed Jun 24 10:35:02 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 24 Jun 2009 09:35:02 -0500 Subject: [fxruby-users] Right mouse menu causes FXList to keep scrolling In-Reply-To: <20090624075020.GA5806@asus> References: <20090624075020.GA5806@asus> Message-ID: <50B23258-4388-4B8C-B38F-3F2DB7E55368@lylejohnson.name> On Jun 24, 2009, at 2:50 AM, Ronald Pijnacker wrote: > The user interface of an application of mine has a couple of > FXLists that are filled enough to get a scroll-bar. > I added a right-mouse pop-up menu to these lists as follows: > The pop-up menu works without problems, but when I invoke it > the underlying list keeps scrolling, even with no buttons pressed. One of the "hidden" features of FXList is that you can click and drag with the right mouse button to scroll the list's contents up and down (instead of using the scroll bar). I suspect that your override of the SEL_RIGHTBUTTONPRESS message is somehow interacting with this feature. What happens if you add a call to ungrab() at the end of the event handler block, e.g. @list.connect(SEL_RIGHTBUTTONPRESS) do |sender, sel, data| # ... everything as before ... @list.ungrab end Another thing you could try is changing the connect() to match on SEL_RIGHTBUTTONRELEASE, although may cause the same problem as SEL_RIGHTBUTTONPRESS is. Hope this helps, Lyle From lyle at lylejohnson.name Wed Jun 24 10:25:09 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 24 Jun 2009 09:25:09 -0500 Subject: [fxruby-users] Learning FXRuby please help! In-Reply-To: <4A41DE34.2080108@phillipses.com> References: <4A41DE34.2080108@phillipses.com> Message-ID: On Jun 24, 2009, at 3:05 AM, Marlene Phillips wrote: > All of this is still rather confusing. So now I tried to layout the > yesWindow on the bottom of the screen with a LAYOUT_BOTTOM when I > define > the yesWindow, but it still appears immediately under my buttons. Any > clues what's happening there? Replace LAYOUT_BOTTOM with LAYOUT_SIDE_BOTTOM: @yesWindow = FXHorizontalFrame.new(self, :opts => FRAME_GROOVE|LAYOUT_FILL_X|LAYOUT_SIDE_BOTTOM) Hope this helps, Lyle From marlene at phillipses.com Wed Jun 24 16:12:10 2009 From: marlene at phillipses.com (Marlene Phillips) Date: Wed, 24 Jun 2009 13:12:10 -0700 Subject: [fxruby-users] Beginner Q: can't get window to show in response to button press In-Reply-To: <15CAB39F-A48A-425F-BBE2-A43ECBD06C8E@lylejohnson.name> References: <15CAB39F-A48A-425F-BBE2-A43ECBD06C8E@lylejohnson.name> Message-ID: <4A42889A.80407@phillipses.com> Lyle, Thanks for both the help and the explanation of what's happening. I'm learning to do GUI programming just from your book, which I'm really appreciating. It's so full of information, though, that I often feel a bit like I'm trying to take a sip from a fire hose! Marlene From marlene at phillipses.com Wed Jun 24 16:26:55 2009 From: marlene at phillipses.com (Marlene Phillips) Date: Wed, 24 Jun 2009 13:26:55 -0700 Subject: [fxruby-users] Learning FXRuby please help! In-Reply-To: References: Message-ID: <4A428C0F.8020200@phillipses.com> Again, thanks Lyle for this help, it solved the problem. Is there somewhere I can find more details on what each of these hints in the API means? For example, I'm afraid I don't know the distinction between "Stick on bottom" (LAYOUT_BOTTOM) and "Pack on bottom" (LAYOUT_SIDE_BOTTOM). And even though I now know that I need to pack the window on the bottom, when I try to read the documentation and see something like "Stick on bottom" I don't know that I should be looking for anything else. I'd love any info on a reference to deciphering some of the terser explanations here. Thanks! From lyle at lylejohnson.name Wed Jun 24 17:14:39 2009 From: lyle at lylejohnson.name (Lyle Johnson) Date: Wed, 24 Jun 2009 16:14:39 -0500 Subject: [fxruby-users] Learning FXRuby please help! In-Reply-To: <4A428C0F.8020200@phillipses.com> References: <4A428C0F.8020200@phillipses.com> Message-ID: On Jun 24, 2009, at 3:26 PM, Marlene Phillips wrote: > Again, thanks Lyle for this help, it solved the problem. Is there > somewhere I can find more details on what each of these hints in the > API > means? For example, I'm afraid I don't know the distinction between > "Stick on bottom" (LAYOUT_BOTTOM) and "Pack on bottom" > (LAYOUT_SIDE_BOTTOM). And even though I now know that > I need to pack the window on the bottom, when I try to read the > documentation and see something like "Stick on bottom" I don't know > that > I should be looking for anything else. I'd love any info on a > reference to deciphering some of > the terser explanations here. To tell you the truth, it's unclear to me (from a cursory examination of the FOX source code) exactly what is the distinction between LAYOUT_BOTTOM and LAYOUT_SIDE_BOTTOM (and other similar pairs of layout hints). There is perhaps some better explanation at the FOX home page: http://www.fox-toolkit.org/ but that web site is not responding at this time. Maybe Jeroen will chime in with some illuminating words... -- Lyle From pijnacker at dse.nl Thu Jun 25 10:18:03 2009 From: pijnacker at dse.nl (Ronald Pijnacker) Date: Thu, 25 Jun 2009 16:18:03 +0200 Subject: [fxruby-users] Right mouse menu causes FXList to keep scrolling In-Reply-To: <50B23258-4388-4B8C-B38F-3F2DB7E55368@lylejohnson.name> References: <20090624075020.GA5806@asus> <50B23258-4388-4B8C-B38F-3F2DB7E55368@lylejohnson.name> Message-ID: <20090625141803.GA9744@asus> > > On Jun 24, 2009, at 2:50 AM, Ronald Pijnacker wrote: > >> The user interface of an application of mine has a couple of >> FXLists that are filled enough to get a scroll-bar. >> I added a right-mouse pop-up menu to these lists as follows: > > > >> The pop-up menu works without problems, but when I invoke it >> the underlying list keeps scrolling, even with no buttons pressed. > > One of the "hidden" features of FXList is that you can click and drag with > the right mouse button to scroll the list's contents up and down (instead > of using the scroll bar). I suspect that your override of the > SEL_RIGHTBUTTONPRESS message is somehow interacting with this feature. What > happens if you add a call to ungrab() at the end of the event handler > block, e.g. > > @list.connect(SEL_RIGHTBUTTONPRESS) do |sender, sel, data| > # ... everything as before ... > @list.ungrab > end Great! This works. Thanks a lot Lyle. This was getting to quite annoying. Ronald From dglnz at yahoo.com Mon Jun 29 06:20:17 2009 From: dglnz at yahoo.com (dave L) Date: Mon, 29 Jun 2009 03:20:17 -0700 (PDT) Subject: [fxruby-users] trouble with program code separation Message-ID: <107535.26217.qm@web30002.mail.mud.yahoo.com> Help, I have a foxGUI gernerated file named monitorwindow and a ruby file called sqlite3_calls.rb I want to have my monitorwindow make calls to sqlite3_calls.rb and pass through parameters to it so i can get data to display to the screen. I have tried making the code (which currently has only ONE method in it called rec_to_find) a class and a module but cannot get the link to work. based on the success i had with example ONE of the user guide ( although it only used a mouse click) i get this error. /sqlite3_calls.rb:18:in `rec_to_find': undefined method `execute' for nil:NilClass (NoMethodError) from monitorscreen.rbw:65:in `construct_widget_tree' from C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2.rb:55:in `call' from C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2.rb:55:in `onHandleMsg' from monitorscreen.rbw:206:in `run' from monitorscreen.rbw:206 >Exit code: 1 here is the code in sqlite3_calls.rb - as a ruby program this works - well as a definition of class it does. require 'sqlite3.rb' module Dbase def initialize @db = SQLite3::Database.new( "customer" ) end def rec_to_find(table, colname, tofind) stmt = "select cust_nos, caddress, cname, contact, notes, on_stop, phone_nos from #{table} where #{colname} = ?" row = @db.execute(stmt,tofind) # this is the line it's borking on - why?? @rec = [] row.each do|fld| @rec = fld end return @rec end end I ahve tried using :: insetad of the fullstop but i get the same error!! also tried having the require sqlite3.rb in the file below but it fails there too - same error. here is some of the code from the mainscreen.rb file. # source generated by foxGUIb 1.0.0 require 'sqlite3_calls.rb' class MainWindow def initialize( parent) extend Dbase @mydb = Dbase construct_widget_tree( parent) init if respond_to? 'init' end def construct_widget_tree( parent) code I've inserted to get the customer data returned. row = rec_to_find('customer', 'cust_nos', @dice_code.text) any help would be appreciated. dave. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dglnz at yahoo.com Mon Jun 29 18:08:31 2009 From: dglnz at yahoo.com (dave L) Date: Mon, 29 Jun 2009 15:08:31 -0700 (PDT) Subject: [fxruby-users] trouble with program code separation Message-ID: <655396.66098.qm@web30005.mail.mud.yahoo.com> Yes I thought so too and tried doing this extend Dbase @db = Dbase.new but it borks because the code is a module not a class! so how would i use it as a class and thus eliminate the problem. I've tried all i know (with my limited knowledge of fxruby/foxGUI & ruby) Tried to make sqlite3_calls.rb a subclass of monitorscreen.rb which is generated by foxGUI but not managed it. your help appriciated. Dave. --- On Tue, 30/6/09, Meinrad Recheis wrote: > From: Meinrad Recheis > Subject: Re: [fxruby-users] trouble with program code separation > To: fxruby-users at rubyforge.org > Received: Tuesday, 30 June, 2009, 2:22 AM > hi dave, at db is nil at the time > rec_to_find is called. make sure it is initialized > correctly.-- henon > > On Mon, Jun 29, 2009 at 12:20 PM, > dave L > wrote: > > Help, > > I have a foxGUI gernerated file named monitorwindow and a > ruby file called sqlite3_calls.rb > > > I want to have my monitorwindow make calls to > sqlite3_calls.rb and pass through parameters to it so i can > get data to display to the screen. > > I have tried making the code (which currently has only ONE > method in it called rec_to_find) a class and a > module but cannot get the link to work. > > > based on the success i had with example ONE of the user > guide ( although it only used a mouse click) i get this > error. > > /sqlite3_calls.rb:18:in `rec_to_find': undefined method > `execute' for nil:NilClass (NoMethodError) > > ??? from monitorscreen.rbw:65:in > `construct_widget_tree' > ??? from > > C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2.rb:55:in > `call' > ??? from > C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2.rb:55:in > `onHandleMsg' > > ??? from monitorscreen.rbw:206:in `run' > ??? from monitorscreen.rbw:206 > >Exit code: 1 > > here is the code in sqlite3_calls.rb - as a > ruby program this works - well as a definition of class it > does. > > > require 'sqlite3.rb' > > module Dbase ? > ? def initialize > ??? @db = SQLite3::Database.new( "customer" ) > ?end > ? > ?def rec_to_find(table, colname, tofind) > ? stmt = "select cust_nos, caddress, cname, contact, > notes, on_stop, phone_nos from #{table} where #{colname} = > ?" > > ? row = @db.execute(stmt,tofind) # this is the line > it's borking on - why?? > ??? @rec > = []??? > ?? row.each do|fld|?????????? > ???? @rec = fld > ?? end?? > ?? return @rec?? > ?end > end > > I ahve tried using :: insetad of the fullstop but i get the > same error!! > > also tried having the require sqlite3.rb in the file below > but it fails there too - same error. > > here is some of the code from the mainscreen.rb file. > > # source generated by foxGUIb 1.0.0 > require 'sqlite3_calls.rb' > > class MainWindow > ? > ??? def initialize( parent)?? > ??? ? ? extend Dbase??? > > ? ?? ?? @mydb = Dbase > ??? ??? construct_widget_tree( parent) > ??? ??? init if respond_to? 'init' > ??? end > ??? > > ??? def construct_widget_tree( parent) > > code I've inserted to get the customer data returned. > > row = rec_to_find('customer', 'cust_nos', > @dice_code.text) > > any help would be appreciated. > > > dave. > > > > > Need mail bonding? Bring all your contacts to > Yahoo!Xtra with TrueSwitch > > _______________________________________________ > > fxruby-users mailing list > > fxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/fxruby-users > > > > -- > -- > Git# --> > Git for .NET > > > > > > > > -----Inline Attachment Follows----- > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users From dglnz at yahoo.com Mon Jun 29 18:14:07 2009 From: dglnz at yahoo.com (dave L) Date: Mon, 29 Jun 2009 15:14:07 -0700 (PDT) Subject: [fxruby-users] trouble with program code separation Message-ID: <414785.2856.qm@web30001.mail.mud.yahoo.com> Henon, Just looking at the code snippet below and want to ask if i should have everything in sqlite3_calls.rb wrapped in a init define as that's what got my 1st sample program working from the user guide. e.g. module Dbase def init # original code put in here end end rgds, dave. --- On Tue, 30/6/09, Meinrad Recheis wrote: > From: Meinrad Recheis > Subject: Re: [fxruby-users] trouble with program code separation > To: fxruby-users at rubyforge.org > Received: Tuesday, 30 June, 2009, 2:22 AM > hi dave, at db is nil at the time > rec_to_find is called. make sure it is initialized > correctly.-- henon > > On Mon, Jun 29, 2009 at 12:20 PM, > dave L > wrote: > > Help, > > I have a foxGUI gernerated file named monitorwindow and a > ruby file called sqlite3_calls.rb > > > I want to have my monitorwindow make calls to > sqlite3_calls.rb and pass through parameters to it so i can > get data to display to the screen. > > I have tried making the code (which currently has only ONE > method in it called rec_to_find) a class and a > module but cannot get the link to work. > > > based on the success i had with example ONE of the user > guide ( although it only used a mouse click) i get this > error. > > /sqlite3_calls.rb:18:in `rec_to_find': undefined method > `execute' for nil:NilClass (NoMethodError) > > ??? from monitorscreen.rbw:65:in > `construct_widget_tree' > ??? from > > C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2.rb:55:in > `call' > ??? from > C:/Ruby1.8/lib/ruby/gems/1.8/gems/fxruby-1.6.16-x86-mswin32-60/lib/fox16/responder2.rb:55:in > `onHandleMsg' > > ??? from monitorscreen.rbw:206:in `run' > ??? from monitorscreen.rbw:206 > >Exit code: 1 > > here is the code in sqlite3_calls.rb - as a > ruby program this works - well as a definition of class it > does. > > > require 'sqlite3.rb' > > module Dbase ? > ? def initialize > ??? @db = SQLite3::Database.new( "customer" ) > ?end > ? > ?def rec_to_find(table, colname, tofind) > ? stmt = "select cust_nos, caddress, cname, contact, > notes, on_stop, phone_nos from #{table} where #{colname} = > ?" > > ? row = @db.execute(stmt,tofind) # this is the line > it's borking on - why?? > ??? @rec > = []??? > ?? row.each do|fld|?????????? > ???? @rec = fld > ?? end?? > ?? return @rec?? > ?end > end > > I ahve tried using :: insetad of the fullstop but i get the > same error!! > > also tried having the require sqlite3.rb in the file below > but it fails there too - same error. > > here is some of the code from the mainscreen.rb file. > > # source generated by foxGUIb 1.0.0 > require 'sqlite3_calls.rb' > > class MainWindow > ? > ??? def initialize( parent)?? > ??? ? ? extend Dbase??? > > ? ?? ?? @mydb = Dbase > ??? ??? construct_widget_tree( parent) > ??? ??? init if respond_to? 'init' > ??? end > ??? > > ??? def construct_widget_tree( parent) > > code I've inserted to get the customer data returned. > > row = rec_to_find('customer', 'cust_nos', > @dice_code.text) > > any help would be appreciated. > > > dave. > > > > > Need mail bonding? Bring all your contacts to > Yahoo!Xtra with TrueSwitch > > _______________________________________________ > > fxruby-users mailing list > > fxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/fxruby-users > > > > -- > -- > Git# --> > Git for .NET > > > > > > > > -----Inline Attachment Follows----- > > _______________________________________________ > fxruby-users mailing list > fxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/fxruby-users